whitespace
[automated-distro-installer] / pxe-server
index 7fced849def066ca634f42b3ab20f27708c9bc94..a59e71c5d48676fd61a6cfc78954f01c8de623fe 100755 (executable)
@@ -41,6 +41,7 @@ TYPE       One of arch, plain, fai.
            after the 2nd. I can't remember exactly why this caused a
            problem, but I'm hoping the sleep will take care of it.
 -S         sets FAI_ACTION=sysinfo, see myfai-chboot for more info.
+-k         Pass -k to myfai-chboot.
 -w         Setup pxe, then wait like -a.
 -h|--help  Print help and exit
 
@@ -64,14 +65,16 @@ dhcp=true
 redep=true
 acks=2
 wait=false
-temp=$(getopt -l help harSw "$@") || usage 1
+chboot_args=()
+temp=$(getopt -l help adrSkwh "$@") || usage 1
 eval set -- "$temp"
 while true; do
     case $1 in
         -a) wait=true; set=false; shift ;;
         -d) dhcp=false; shift ;;
         -r) redep=false; shift ;;
-        -S) chboot_arg=-S; shift ;;
+        -S) chboot_args+=(-S); shift ;;
+        -k) chboot_args+=(-k); shift ;;
         -w) wait=true; set=true; shift ;;
         -h|--help) usage ;;
         --) shift; break ;;
@@ -90,6 +93,12 @@ case $# in
         ;;
 esac
 
+if $wait && ! $dhcp; then
+    echo "$0: error -w conflicts with -d, choose one or other"
+    exit 1
+fi
+
+
 if [[ $host && $host != default ]]; then
     host_tag="tag:$host,"
 fi
@@ -151,7 +160,7 @@ $([[ $type == arch ]] && echo arch-pxe-mount)"
 if $set; then
     set-pxe
     if [[ $type == fai ]]; then
-        e myfai-chboot $chboot_arg $host
+        e myfai-chboot ${chboot_args[@]} $host
         if $redep; then
             e fai-redep
         fi