X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=faiserver-disable;h=74aaef8664b806c6e10e6a9cb8329518840e3d66;hb=fd75a734a7149cf203553d36270482af37e680da;hp=65e2aa844b6e861b32b3f07ac6c5c91a465e525e;hpb=a69dd442e7381deaec866989a4944efa4f73a8c3;p=automated-distro-installer diff --git a/faiserver-disable b/faiserver-disable index 65e2aa8..74aaef8 100755 --- a/faiserver-disable +++ b/faiserver-disable @@ -1,16 +1,17 @@ #!/bin/bash -readonly this_file="$(readlink -f -- "${BASH_SOURCE[0]}")" -script_dir="${this_file%/*}" -# shellcheck source=./bash-trace -source "${script_dir}/bash-trace" -cd $script_dir -source "${script_dir}/bash-trace" +if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi +shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 +set -eE -o pipefail +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR +this_file="$(readlink -f -- "${BASH_SOURCE[0]}")" +readonly this_file this_dir="${this_file%/*}" +cd "$this_dir" usage() { - cat </dev/null; then echo "$0: disabling fai nfs exports or apache site" ./faiserver-disable-local else - echo "$0: sshing to $(chost faiserver) to disable fai nfs exports or apache site" - ssh root@$(chost faiserver) bash