From 3592ea524b37238ff9fd4a6b058ebf48ad4ef02e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 9 Aug 2018 12:42:42 +0000 Subject: [PATCH] cleanup... --- debian/wit-network-config.postinst | 5 +++-- debian/wit-network-config.transform | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/wit-network-config.postinst b/debian/wit-network-config.postinst index 40bdd87..b39662e 100755 --- a/debian/wit-network-config.postinst +++ b/debian/wit-network-config.postinst @@ -32,8 +32,8 @@ case "$1" in export TIER_ID=$(echo $LOOPBACKv4 | cut -d . -f 3) export NODE_ID=$(echo $LOOPBACKv4 | cut -d . -f 4) + export DOMAINNAME=${HOSTNAME#*.} - export DOMAINNAME=${HOSTNAME#*.} if [ -z "$TIER_ID" ]; then echo "Unable to autodetect TIER_ID, looks like we deal with a special node, please set in environment" @@ -44,6 +44,7 @@ case "$1" in exit 2 fi + export NODE_ASN="4200$(printf "%03d" $TIER_ID)$(printf "%03d" $NODE_ID)" export LOOPBACKv6="2604:bbc0::$TIER_ID:$NODE_ID" @@ -55,7 +56,7 @@ case "$1" in ## START writing config files - sed -i -e '/#*PasswordAuthentication /d' /etc/ssh/sshd_config + sed -i -e '/#*\s*PasswordAuthentication /d' /etc/ssh/sshd_config echo "PasswordAuthentication no" >>/etc/ssh/sshd_config diff --git a/debian/wit-network-config.transform b/debian/wit-network-config.transform index 76809bf..cf8f115 100644 --- a/debian/wit-network-config.transform +++ b/debian/wit-network-config.transform @@ -1,4 +1,4 @@ /etc/systemd/timesyncd.conf.wit sed -e 's/#NTP=.*/NTP=ipv6.ntp.ubuntu.com/g' /etc/frr/daemons.wit sed -e 's/bgpd=no/bgpd=yes/' -e 's/zebra=no/zebra=yes/' /etc/bash.bashrc.wit sed -e 's/.*witaddon/source \/etc\/bashrc-witaddon/; t; $ s/$/\nsource \/etc\/bashrc-witaddon/' -/etc/dhcp/dhclient.conf.wit sed -e '/^option.*loopbackv4/d;' | sed -e '1s/^/option loopbackv4 code 225 = ip-address;\n/;' +/etc/dhcp/dhclient.conf.wit sed -e 's/^option.*loopbackv4.*/option loopbackv4 code 225 = ip-address;/; t; 1s/^/option loopbackv4 code 225 = ip-address;\n/'