iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
various improvements
[automated-distro-installer]
/
faiserver-setup
diff --git
a/faiserver-setup
b/faiserver-setup
index 1bfbacb547e18f00fc2dd50da79f1f5615a029d8..3b9ab80f14fef060f1dc20ac94bf48698e127922 100755
(executable)
--- a/
faiserver-setup
+++ b/
faiserver-setup
@@
-1,6
+1,9
@@
#!/bin/bash
#!/bin/bash
-# initial setup of a fai server on debian
+# Initial setup of a fai server on debian. works on localhost.
+# Set's the current ip as the tftp server. I vaguely remember
+# that using a hostname does not work
+# Requires changing dns to point faiserver and running fai-redep
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
@@
-63,6
+66,7
@@
std_arg="-u nfs://faiserver/srv/fai/config"
fai-chboot -Iv $std_arg default # reset so we are idempotent
kernel=$(fai-chboot -L '^default$' | awk '{print $3}')
type -t host &>/dev/null || apt-get -y install dnsutils
fai-chboot -Iv $std_arg default # reset so we are idempotent
kernel=$(fai-chboot -L '^default$' | awk '{print $3}')
type -t host &>/dev/null || apt-get -y install dnsutils
+# resolve host using gateway address
my_ip=$(host faiserver $(route -n | sed -rn 's/^(0\.){3}0\s+(\S+).*/\2/p') | \
sed -rn 's/^\S+ has address //p')
k_args=$(fai-chboot -L '^default$' | \
my_ip=$(host faiserver $(route -n | sed -rn 's/^(0\.){3}0\s+(\S+).*/\2/p') | \
sed -rn 's/^\S+ has address //p')
k_args=$(fai-chboot -L '^default$' | \