From e3b061d899af3bc38c5b2ae7972a8e80935b97a6 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sun, 28 Feb 2021 21:13:35 +0000 Subject: Fix bug where the CIDR mask was included in /etc/hosts. --- netconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'netconfig') 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 # ############################################################################ -- cgit v1.2.3