X-Git-Url: https://plomlompom.com/repos/?p=config;a=blobdiff_plain;f=buster%2Fsetup_scripts%2Fset_hostname_and_fqdn.sh;h=a3b9f9a9651747229b7442eb5fea1e3a87a5d985;hp=3f95590bce3b4ff47abeb206cdc60bd36fadabe0;hb=077f3ef4a11d4d013f1ad0882811c597499ad7ce;hpb=27942fc7dfadcc26b4fff15974af2b0faa675730 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