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
fixes, t11, install in ad-hoc network
[automated-distro-installer]
/
myfai-chboot-local
diff --git
a/myfai-chboot-local
b/myfai-chboot-local
index 8ab5a92117a568ec3bf259e333fc0c4b121952c8..cef41c4347ea32939de34d1146808860417876be 100755
(executable)
--- a/
myfai-chboot-local
+++ b/
myfai-chboot-local
@@
-34,6
+34,10
@@
while [[ $1 == -* ]]; do
bond=true
shift
;;
bond=true
shift
;;
+ --no-r)
+ fai_reboot_arg=
+ shift
+ ;;
esac
done
esac
done
@@
-44,15
+48,27
@@
err() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $pre: $*" >&2; }
host=$1
host=$1
+
rm -f /srv/tftp/fai/pxelinux.cfg/*
if [[ ! $1 ]]; then
echo "$0: clearing pxe config and exiting"
exit 0
fi
rm -f /srv/tftp/fai/pxelinux.cfg/*
if [[ ! $1 ]]; then
echo "$0: clearing pxe config and exiting"
exit 0
fi
+# somewhat duplicated in brc hostip()
+ case $host in
+ [0-9:])
+ hostip=$host
+ ;;
+ *)
+ hostip=$(getent ahostsv4 "$host" | awk '{ print $1 }' | head -n1)
+ ;;
+ esac
+
+
# assuming ipv4, or else we might need to deal with multiple addresses
# in an ipv4 + ipv6 network.
# assuming ipv4, or else we might need to deal with multiple addresses
# in an ipv4 + ipv6 network.
-my_ip=$(ip -4 route get
8.8.8.8
| sed -nr 's,^.*src\s+(\S+).*,\1,p')
+my_ip=$(ip -4 route get
$hostip
| sed -nr 's,^.*src\s+(\S+).*,\1,p')
if [[ ! $my_ip || $my_ip =~ [[:space:]] ]]; then
echo "$0: error: failed to get \$my_ip, got: $my_ip"
exit 1
if [[ ! $my_ip || $my_ip =~ [[:space:]] ]]; then
echo "$0: error: failed to get \$my_ip, got: $my_ip"
exit 1