summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2021-02-28 21:13:35 +0000
committerDarren 'Tadgy' Austin <darren@afterdark.org.uk>2021-02-28 21:13:35 +0000
commite3b061d899af3bc38c5b2ae7972a8e80935b97a6 (patch)
tree98dff8218f9d02f31e00c36f3759e4536c42d38d
parentdd89f423ded06bc7ff3e9be6bda7090d44fd22f4 (diff)
downloadslacknetsetup-e3b061d899af3bc38c5b2ae7972a8e80935b97a6.tar.xz
Fix bug where the CIDR mask was included in /etc/hosts.
-rw-r--r--netconfig4
1 files changed, 2 insertions, 2 deletions
diff --git a/netconfig b/netconfig
index f7cdc9a..fcb607e 100644
--- a/netconfig
+++ b/netconfig
@@ -305,8 +305,8 @@ chmod 644 $ETCNETWORKS
127.0.0.1 localhost
::1 localhost
EOF
-[ -n "${IPADDRS[0]}" ] && echo -e "${IPADDRS[0]}\t\t$HOSTNM.$DOMAIN $HOSTNM" >>$HOSTS
-[ -n "${IP6ADDRS[0]}" ] && echo -e "${IP6ADDRS[0]}\t\t$HOSTNM.$DOMAIN $HOSTNM" >>$HOSTS
+[ -n "${IPADDRS[0]}" ] && echo -e "${IPADDRS[0]%%/*}\t\t$HOSTNM.$DOMAIN $HOSTNM" >>$HOSTS
+[ -n "${IP6ADDRS[0]}" ] && echo -e "${IP6ADDRS[0]%%/*}\t\t$HOSTNM.$DOMAIN $HOSTNM" >>$HOSTS
chmod 644 $HOSTS
#
############################################################################