arch use by-id and various fixes
[automated-distro-installer] / pxe-server
index 4d18ccb742dcad33e9d9691372a0e711e4ac4ef8..6d2411ee5460d713b8a7ededdbdeaccef234e6c3 100755 (executable)
@@ -3,13 +3,16 @@
 # Setup dhcp server to point to tftp server,
 # and depending on the type, setup the tftp server.
 
-# usage: $0 [TYPE]
+# usage: $0 TYPE
 # default distro is the base debian/fedora type. others are fai &  arch
 
 set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
 
-action=${1:-default}
+if [[ ! $1 ]]; then
+    echo "$0: error: exptected 1 argument of type"
+fi
+action=$1
 
 arch() {
     default
@@ -20,7 +23,9 @@ dhcp-boot=/arch/boot/syslinux/lpxelinux.0
 EOF
 }
 
-default() {
+plain-tftp() {
+    # if arch was used before, this additionally needs
+    # the tftp link in /mnt/usb to be changed.
     cat <<'EOF'
 enable-tftp
 tftp-root=/mnt/usb/tftpboot