X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=pxe-server;h=37dbb7957c5ee572336359dd1755003318c4fe22;hb=6315fdaa029f0f107d98fde18ab584f958e06108;hp=6137386a1188d9ab9c50e4bee783e7ee57dfc053;hpb=3d9cc96092cdc8aa05bc95cf83c07bb1af692013;p=automated-distro-installer diff --git a/pxe-server b/pxe-server index 6137386..37dbb79 100755 --- a/pxe-server +++ b/pxe-server @@ -61,6 +61,11 @@ EOF exit $1 } +pre="${0##*/}:" +m() { printf "$pre %s\n" "$*"; "$@"; } +e() { printf "$pre %s\n" "$*"; } +err() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $pre: $*" >&2; } + ##### begin command line parsing ######## dhcp=true @@ -70,7 +75,7 @@ wait=false fsf=false case $HOSTNAME in - x2|x3|kw) fsf=true ;; + x3|kw) fsf=true ;; esac chboot_args=() @@ -125,16 +130,11 @@ fi ##### end command line parsing ######## -e() { - echo "$@" - "$@" -} - archlike() { cat </dev/null || sudo apt-get -y install dnsutils +faiserverip=$(host faiserver | sed -rn 's/^\S+ has address //p;T;q' ||:) +if [[ ! $faiserverip || $faiserverip =~ [[:space:]] ]]; then + echo "$0: error: failed to get \$faiserverip, got: $faiserverip" + exit 1 +fi + if $set; then set-pxe if [[ $type == fai ]]; then - e myfai-chboot ${chboot_args[@]} $host if $redep; then - e fai-redep + m fai-redep fi + m myfai-chboot ${chboot_args[@]} $host else # This will fail if faiserver is not setup, so ignore any # failure and don't bother us about it.