X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=faiserver-disable;h=74aaef8664b806c6e10e6a9cb8329518840e3d66;hb=fd92920315ea1ec28049041f74011324c750c667;hp=7893524426844344d3d5e6d5f16d5c95db14b8b1;hpb=afabe0c27af744200aa6b6e05c5b2ab7d7518c1e;p=automated-distro-installer diff --git a/faiserver-disable b/faiserver-disable index 7893524..74aaef8 100755 --- a/faiserver-disable +++ b/faiserver-disable @@ -1,18 +1,33 @@ #!/bin/bash +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\" returned $?" >&2' ERR +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.b8.nz) to disable fai nfs exports or apache site" + ssh root@$(chost faiserver.b8.nz) bash