Moving ip separator variable to the beginning in order to overwrite it through /etc...
authorDaniel Baumann <daniel@debian.org>
Mon, 7 Jan 2013 23:15:21 +0000 (00:15 +0100)
committerDaniel Baumann <daniel@debian.org>
Mon, 7 Jan 2013 23:15:21 +0000 (00:15 +0100)
scripts/config.sh
scripts/config/0020-hostname

index d99c2df..f0b82e9 100755 (executable)
@@ -32,6 +32,7 @@ DEBIAN_FRONTEND="noninteractive"
 DEBIAN_PRIORITY="critical"
 DEBCONF_NOWARNINGS="yes"
 
+IP_SEPARATOR="-"
 PROC_OPTIONS="onodev,noexec,nosuid"
 
 Cmdline ()
index fb09c48..0cd4422 100755 (executable)
@@ -41,11 +41,9 @@ Configure_hostname ()
                # Supporting variables within hostnames
                if [ -e /bin/ip ]
                then
-                       _IP_SEPARATOR="${_IP_SEPARATOR:--}"
-
-                       LINK="$(ip -oneline -family link address show dev eth0 | awk '{ print $13 }' | sed -e "s|:|${_IP_SEPARATOR}|g")"
-                       INET="$(ip -oneline -family inet address show dev eth0 | awk '{ print $4 }' | sed -e "s|\.|${_IP_SEPARATOR}|g" -e 's|/.*||')"
-                       INET6="$(ip -oneline -family inet6 address show dev eth0 | awk '{ print $4 }' | sed -e "s|:|${_IP_SEPARATOR}|g" -e 's|/.*||' -e 's|--|-|')"
+                       LINK="$(ip -oneline -family link address show dev eth0 | awk '{ print $13 }' | sed -e "s|:|${IP_SEPARATOR}|g")"
+                       INET="$(ip -oneline -family inet address show dev eth0 | awk '{ print $4 }' | sed -e "s|\.|${IP_SEPARATOR}|g" -e 's|/.*||')"
+                       INET6="$(ip -oneline -family inet6 address show dev eth0 | awk '{ print $4 }' | sed -e "s|:|${IP_SEPARATOR}|g" -e 's|/.*||' -e 's|--|-|')"
 
                        eval LIVE_HOSTNAME="${LIVE_HOSTNAME}"
                fi