X-Git-Url: https://plomlompom.com/repos/test.html?a=blobdiff_plain;f=buster%2Fsetup_scripts%2Fset_hostname_and_fqdn.sh;h=a3b9f9a9651747229b7442eb5fea1e3a87a5d985;hb=ac02dd68f29f0b22df51bc73ce4b1a47c2c1e1c6;hp=3f95590bce3b4ff47abeb206cdc60bd36fadabe0;hpb=294f68b4b41770a485517e2f492b643d2061a488;p=config
diff --git a/buster/setup_scripts/set_hostname_and_fqdn.sh b/buster/setup_scripts/set_hostname_and_fqdn.sh
index 3f95590..a3b9f9a 100755
--- a/buster/setup_scripts/set_hostname_and_fqdn.sh
+++ b/buster/setup_scripts/set_hostname_and_fqdn.sh
@@ -10,6 +10,8 @@
# on our systems) or to 127.0.1.1 if not. On the reasoning for separating
# localhost and hostname mapping to different IPs, see
# .
+#
+# Ignores IPv6s.
set -e
hostname="$1"
@@ -23,6 +25,9 @@ hostname "${hostname}"
final_ip="127.0.1.1"
for ip in $(hostname -I); do
+ if [ $(echo "${ip}" | grep ':' | wc -l) -eq 1 ]; then
+ continue
+ fi
range_1=$(echo "${ip}" | cut -d "." -f 1)
range_2=$(echo "${ip}" | cut -d "." -f 2)
if [ "${range_1}" -eq 127 ]; then