[Fai-commit] r4067 - trunk/bin
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Sun Oct 8 22:59:02 UTC 2006
Author: lange
Date: 2006-10-08 22:59:00 +0000 (Sun, 08 Oct 2006)
New Revision: 4067
Modified:
trunk/bin/fai
Log:
add option -u,--hostname (closes: #390367)
Modified: trunk/bin/fai
===================================================================
--- trunk/bin/fai 2006-10-07 13:35:05 UTC (rev 4066)
+++ trunk/bin/fai 2006-10-08 22:59:00 UTC (rev 4067)
@@ -80,6 +80,13 @@
[ "$FAI_ROOT" = '/' ] && ROOTCMD=
target=$FAI_ROOT
+ if [ X$action = Xdirinst -a -n "$newhostname" ]; then
+ HOSTNAME=$newhostname
+ HOST=$newhostname
+ unset newhostname
+ echo "Hostname set to $HOST" | tee -a $LOGDIR/fai.log
+ fi
+
if [ $do_init_tasks -eq 1 ]; then
trap 'echo "Now rebooting";faireboot' INT QUIT
else
@@ -150,7 +157,7 @@
# Main routine
# Parse commandline options
-TEMP=$(getopt -o Nhvc:C: --long new,help,verbose,class:,cfdir: -n "$0" -- "$@")
+TEMP=$(getopt -o u:Nhvc:C: --long 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"
@@ -186,6 +193,10 @@
shift
cmdlineclasses=${cmdlineclasses//,/ }
;;
+ -u|--hostname)
+ shift
+ export newhostname=$1
+ ;;
--)
shift
break
More information about the Fai-commit
mailing list