X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai-kexec;h=ae59f7cb3d6d56da7d5f742385152860cee541be;hp=dbf003be355563b8188b02240e7bae7f61f681f8;hb=f26c5d66d11fc97c3c6a17a3647dad5d1922fe5a;hpb=83828fe2683227f4d8ecb2343eff28439741b490 diff --git a/fai-kexec b/fai-kexec index dbf003b..ae59f7c 100755 --- a/fai-kexec +++ b/fai-kexec @@ -17,25 +17,25 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR +[[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@" usage() { cat <<'EOF' usage: $0 [-h|--help] [SERVER] -kexec to SERVER (faiserver by default), pxe boot from it's tftp server +Kexec this or a remote machine using host faiserver -This does what pxe would do, but skipping boot sequence up to and -including the pxe dhcp. +If SERVER argument, ssh to root@SERVER before doing kexec. This does +what pxe would do, but skipping boot sequence up to and including the +pxe dhcp. EOF exit $1 } - case $1 in -h|--help) usage ;; esac - if [[ $1 ]]; then prefix="ssh root@$1" fi