add rescue, fix default pxe, ubuntu locale
[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]
11
12 Sets up tftp pxe config and nfs server on host "faiserver".
13
14 If our kernel has no nfs support, uses apache, and depends on another
15 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 case $1 in
33 -h|--help) usage ;;
34 esac
35
36
37 host=$(chost faiserver)
38 ssh root@$host bash -s -- "$@" <myfai-chboot-local