Package: fai-client Tags: patch The Hostname given with -u on dirinstall is ignored when class definition runs for dirinstall. That's because fai-class sets it to something parsed form uname in the setup function.
Thats's bad because that way one can never do class definition based on the (desired later) hostname when doing a dirinstall. This patch helps with that. (and finally add the getopt for the long --hostname that is already documented in the manpage). filet:/hier/sources/fai/trunk# svn diff Index: bin/fai =================================================================== --- bin/fai (revision 4210) +++ bin/fai (working copy) @@ -158,7 +158,7 @@ # Main routine # Parse commandline options -TEMP=$(getopt -o u:Nhvc:C: --long new,help,verbose,class:,cfdir: -n "$0" -- "$@") +TEMP=$(getopt -o u:Nhvc:C: --long hostname:,new,help,verbose,class:,cfdir: -n "$0" -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" Index: bin/fai-class =================================================================== --- bin/fai-class (revision 4210) +++ bin/fai-class (working copy) @@ -131,7 +131,11 @@ verbosemsg "Setting LOGDIR to default value /tmp/fai" LOGDIR=/tmp/fai; export LOGDIR fi - HOSTNAME=$(uname -n | cut -d. -f1); export HOSTNAME + if [ -n $HOST ]; then + export HOSTNAME=$HOST + else + HOSTNAME=$(uname -n | cut -d. -f1); export HOSTNAME + fi } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # main program -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]