fixing the preinst script to rely on DNS as well

This commit is contained in:
toby 2018-09-09 13:32:32 +02:00
parent 8a53109d81
commit 769ef9695f
1 changed files with 5 additions and 5 deletions

View File

@ -16,15 +16,15 @@ set -e
case "$1" in
install|upgrade)
source /etc/wit-net.conf
export DOMAINNAME=${HOSTNAME#*.}
export LOOPBACKv4=$(dig +short ${HOSTNAME%%.*}.loopback.${HOSTNAME#*.})
export TIER_ID=$(echo $LOOPBACKv4 | cut -d . -f 3)
export NODE_ID=$(echo $LOOPBACKv4 | cut -d . -f 4)
if [ -z $LOOPBACKv4 ]; then
echo "LOOPBACK NOT CONFIGURED, aborting..."
exit 2
fi
if [[ $LOOPBACKv4 != "10.1."* ]]; then
echo "only 10.1.x.y loopbacks supported at the moment"
exit 3
fi
systemctl stop systemd-networkd.socket
systemctl stop systemd-networkd.service
systemctl stop systemd-networkd-wait-online