]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Bugfixing bin/postinst
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 30 Oct 2018 10:52:58 +0000 (11:52 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 30 Oct 2018 10:52:58 +0000 (11:52 +0100)
bin/postinst

index f68a36bd46adafcbda28d835b54e1908a46d8054..3742e94a3fc57c56d0adb2830ec21785fc19a88f 100644 (file)
@@ -14,6 +14,10 @@ IP_ADDRESS_ETH0=$( host "${hostname}" | sed -e 's/.*has address[     ][      ]*//' )
 DOMAIN=$( echo "${hostname}" | cut -d. -f2,3 )
 SIMPLE_HOSTNAME=$( echo "${hostname}" | cut -d. -f1 )
 
+if [[ -z "${ip_address_eth0}" ]] ; then
+    ip_address_eth0="${IP_ADDRESS_ETH0}"
+fi
+
 ROOT_PW_CRYPTED="\$6\$I0yXrNsT\$YU3ekjNLy1KTWLRVNww8YM1xtO8FXgTEFhOANS.HB8baj7CxNMRCoxDQh5oFYkZbli67s4pwZ36aNchD2YL.G0"
 
 GIT_ACCOUNT="vmware-provisioning"
@@ -197,6 +201,10 @@ install_network() {
     mv -v /etc/sysconfig/network "/etc/sysconfig/network.orig.$( date -r /etc/sysconfig/network +'%Y-%m-%d_%H:%M:%S' )"
     mv -v "${tmp_nw_cfg}" /etc/sysconfig/network
 
+    echo "Generated /etc/sysconfig/network:"
+    cat /etc/sysconfig/network || true
+    echo
+
     # Also set the hostname now, some applications require it
     /bin/hostname "${hostname}"
 
@@ -230,9 +238,12 @@ install_network() {
         mv -v "${ifcfg_file}" "${old_dir}"
     done
     mv -v "${dev_file}" "${nw_script_dir}"
-
     rm -vrf "${temp_dir}"
 
+    echo "Generated ${nw_script_dir}/ifcfg-eth0:"
+    cat "${nw_script_dir}/ifcfg-eth0" || true
+    echo
+
 }
 
 #-----------------------------------------------------------