summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-config/networkconfig.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/LinHES-config/networkconfig.sh')
-rw-r--r--abs/core-testing/LinHES-config/networkconfig.sh52
1 files changed, 39 insertions, 13 deletions
diff --git a/abs/core-testing/LinHES-config/networkconfig.sh b/abs/core-testing/LinHES-config/networkconfig.sh
index 9ad2d4e..23e3774 100644
--- a/abs/core-testing/LinHES-config/networkconfig.sh
+++ b/abs/core-testing/LinHES-config/networkconfig.sh
@@ -43,6 +43,22 @@ fi
}
+function change_iface_state () {
+ if [ x$2 = xenabled ]
+ then
+ echo "setting $1 to active"
+ sed -i -e 's/^ONBOOT=.*$/ONBOOT=yes/g' $ETCNETDIR/$1/options
+ sed -i -e 's/^DISABLED=.*$/DISABLED=no/g' $ETCNETDIR/$1/options
+ else
+ echo "setting $1 to inactive"
+ sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options
+ sed -i -e 's/^DISABLED=.*$/DISABLED=yes/g' $ETCNETDIR/$1/options
+ /sbin/ifconfig $1 down
+ ip address flush $1
+ fi
+
+}
+
function setup_interfaces() {
local IS_WIRELESS
local ip
@@ -110,14 +126,17 @@ function setup_interfaces() {
cp -f $TEMPLATES/etcnet/eth/options $ETCNETDIR/$1/options
fi
- if [ x$isactive = x0 ]
+ if [ x$isactive = x1 ]
then
- echo "setting $1 to inactive"
- sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options
-
+ change_iface_state $1 enabled
+ #echo "setting $1 to active"
+ #sed -i -e 's/^ONBOOT=.*$/ONBOOT=yes/g' $ETCNETDIR/$1/options
+ #sed -i -e 's/^DISABLED=.*$/DISABLED=no/g' $ETCNETDIR/$1/options
else
- echo "setting $1 to active"
- sed -i -e 's/^ONBOOT=.*$/ONBOOT=yes/g' $ETCNETDIR/$1/options
+ change_iface_state $1 disabled
+ #echo "setting $1 to inactive"
+ #sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options
+ #sed -i -e 's/^DISABLED=.*$/DISABLED=yes/g' $ETCNETDIR/$1/options
fi
if [ x$IS_WIRELESS = xTRUE ]
@@ -139,7 +158,7 @@ function setup_interfaces() {
- if [ $UseDHCP = 0 ]
+ if [ x$UseDHCP = x0 ]
then
echo using dhcp
sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=dhcp/g' $ETCNETDIR/$1/options
@@ -168,11 +187,16 @@ for i in eth0 eth1 wlan0 wlan1
do
CURRENTIF="HostActive"$i
eval IFSTATE=\$${CURRENTIF}
+ echo $IFSTATE "---"
+ echo $i
if [ x$IFSTATE = x1 ]
then
setup_interfaces $i
+ else
+ change_iface_state $i disabled
fi
done
+
}
function setup_hostname {
@@ -233,23 +257,25 @@ function setup_MYTH_vars {
-function setup_network {
- setup_MYTH_vars
- setup_hostname
- find_active
-}
function start_network {
if [ ! $USEVNC = 0 ]
then
+ /etc/net/scripts/network.init reload
/etc/net/scripts/network.init restart
-
else
echo "VNC/NETBOOT in use, will NOT restart network"
fi
}
+function setup_network {
+ setup_MYTH_vars
+ setup_hostname
+ find_active
+}
+
+
function stop_network {
if [ ! $USEVNC = 0 ]
then