minor fixes
[automated-distro-installer] / myfai-chboot
1 #!/bin/bash
2
3 set -eE -o pipefail
4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
5
6 x=$(readlink -f "$BASH_SOURCE"); cd ${x%/*}
7
8 usage() {
9 cat <<EOF
10 usage: ${0##*/} [-h|--help] HOSTNAME|IP|default
11
12 Sets up tftp pxe config and nfs server on host "faiserver".
13
14 If our kernel has no nfs support, uses apache intead of nfs, and depends
15 on another repo of Ian Kelling, basic-https-conf, where the file is at
16 /a/exe/web-conf.
17
18 Usng this, you can boot into fai with pxe-kexec without changing
19 the dhcp server.
20
21 Argument sets the host to enable it for. No argument disables pxe
22 config for all hosts, but leaves nfs server alone. Use faiserver-disable
23 to disable the nfs server.
24
25 -S sets FAI_ACTION=sysinfo, and remove fai flag reboot.
26 Usefull for doing a system recovery.
27 -h|--help Print help and exit.
28
29 EOF
30 exit $1
31 }
32 if [[ ! $1 ]]; then
33 usage 1
34 fi
35 case $1 in
36 -h|--help) usage ;;
37 esac
38
39
40 host=$(chost faiserver)
41 ssh root@$host bash -s -- "$@" <myfai-chboot-local