diff options
Diffstat (limited to 'util/ks.cfg')
-rw-r--r-- | util/ks.cfg | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/util/ks.cfg b/util/ks.cfg index 7d70e6f2..9e33f42f 100644 --- a/util/ks.cfg +++ b/util/ks.cfg @@ -166,7 +166,11 @@ function save_nic_cfg() { } function save_gateway() { - echo GATEWAY=$gw >> /etc/sysconfig/network + if [[ -z $external_gw ]]; then + echo GATEWAY=$gw >> /etc/sysconfig/network + else + echo GATEWAY=$external_gw >> /etc/sysconfig/network + fi search="domain $domain\nsearch $domain" echo -e "${search}\nnameserver 127.0.0.1" > /etc/resolv.conf [ $dns1 ] && echo -e "${search}\nnameserver $dns1" > /etc/resolv.conf @@ -175,7 +179,11 @@ function save_gateway() { [ $dns2 ] && echo "nameserver $dns2" >> /etc/dnsmasq.upstream if [[ -z "$dns1" && -z "$dns2" ]]; then - echo "nameserver $gw" >> /etc/resolv.conf + if [[ -z $external_gw ]]; then + echo "nameserver $gw" >> /etc/resolv.conf + else + echo "nameserver $external_gw" >> /etc/resolv.conf + fi fi } # Default FQDN @@ -184,19 +192,29 @@ hostname="compass" for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done domain=$hostname gw=$gw +ex_gw=$external_gw install_ip=$install_ip install_netmask=$install_netmask install_intf="eth1" install_hwaddr=`ifconfig $install_intf | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'` +save_nic_cfg $install_intf $install_ip $install_netmask $install_hwaddr + mgmt_ip=$mgmt_ip mgmt_netmask=$mgmt_netmask mgmt_intf="eth0" mgmt_hwaddr=`ifconfig $mgmt_intf | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'` -save_nic_cfg $install_intf $install_ip $install_netmask $install_hwaddr save_nic_cfg $mgmt_intf $mgmt_ip $mgmt_netmask $mgmt_hwaddr + +external_ip=$external_ip +external_netmask=$external_mask +external_intf="eth2" +external_hwaddr=`ifconfig $external_intf | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'` + +save_nic_cfg $external_intf $external_ip $external_netmask $external_hwaddr + save_gateway # already chroot |