From 769ef9695fba3bf012c613ec1270532442d64bb4 Mon Sep 17 00:00:00 2001 From: toby Date: Sun, 9 Sep 2018 13:32:32 +0200 Subject: [PATCH] fixing the preinst script to rely on DNS as well --- debian/wit-network-config.preinst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/wit-network-config.preinst b/debian/wit-network-config.preinst index d17ce56..077c832 100755 --- a/debian/wit-network-config.preinst +++ b/debian/wit-network-config.preinst @@ -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