add rescue, fix default pxe, ubuntu locale
[automated-distro-installer] / faiserver-disable
1 #!/bin/bash
2
3 set -eE -o pipefail
4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
5
6 usage() {
7 cat <<EOF
8 Usage: ${0##*/}
9 Disable the fai nfs server exports
10 EOF
11 exit $1
12 }
13
14 if [[ $1 ]]; then
15 usage 1
16 fi
17
18 ssh root@$(chost faiserver) bash <<'EOF'
19 if modprobe nfsd &>/dev/null; then
20 sed -ri --follow-symlinks '\%^/srv/fai/d' /etc/exports
21 exportfs -ra
22 else
23 rm -f /etc/apache2/sites-enabled/faiserver.conf
24 systemctl reload apache2
25 fi
26 EOF