X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=pxe-server;h=e59854a85e466be75cbad22733ded83cae6c077e;hb=1fe036ae3d279dbd1d60bef38dc42154507892c4;hp=0bdd13401e4238995ca0ccec985c0ca88d7ddf73;hpb=2eebb95531424e04797094d622eebdd7ece5b38b;p=automated-distro-installer diff --git a/pxe-server b/pxe-server index 0bdd134..e59854a 100755 --- a/pxe-server +++ b/pxe-server @@ -28,13 +28,23 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR usage() { cat < tftpboot + + +-r Don't redeploy fai config. For example, if there is a different host + that is mid-install. -a Wait for 2 dhcp acks, then disable the pxe server after a delay. First ack is for pxe boot, 2nd ack is for os boot. Sometimes on debian, there is a 3rd one shortly after the 2nd. I can't remember @@ -68,12 +78,16 @@ while true; do esac done -read type host <<<"$@" +read host type <<<"$@" -if [[ ! $type ]]; then - echo "$0: error: exptected 1 argument of type" - usage 1 -fi +case $# in + 0|2);; + *) + echo "$0: error: expected 0 or 2 arguments" + echo + usage 1 + ;; +esac if [[ $host ]]; then host_tag="tag:$host," @@ -105,7 +119,7 @@ EOF fai() { cat <