summaryrefslogtreecommitdiffstats
path: root/abs/mv-core
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2008-12-11 00:49:40 (GMT)
committerJames Meyer <james.meyer@operamail.com>2008-12-11 00:49:40 (GMT)
commit42129857874c470c65d3b1dcb4bf42945a98dcfa (patch)
tree980501a63d53d1e0c8af32d0decf754baf4d11fc /abs/mv-core
parent81a5d9fb48a4b6a348336644c153bd1bf8456957 (diff)
downloadlinhes_pkgbuild-42129857874c470c65d3b1dcb4bf42945a98dcfa.zip
linhes_pkgbuild-42129857874c470c65d3b1dcb4bf42945a98dcfa.tar.gz
linhes_pkgbuild-42129857874c470c65d3b1dcb4bf42945a98dcfa.tar.bz2
Fix interfaces not being disabled when they are in fact disabled in the gui.
ref FS#58
Diffstat (limited to 'abs/mv-core')
-rw-r--r--abs/mv-core/MythVantage-config/networkconfig.sh53
-rwxr-xr-xabs/mv-core/MythVantage-config/systemconfig.sh1
2 files changed, 40 insertions, 14 deletions
diff --git a/abs/mv-core/MythVantage-config/networkconfig.sh b/abs/mv-core/MythVantage-config/networkconfig.sh
index 9ad2d4e..b4ffd5c 100644
--- a/abs/mv-core/MythVantage-config/networkconfig.sh
+++ b/abs/mv-core/MythVantage-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,24 @@ 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 restart
-
+ /etc/net/scripts/network.init reload
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
diff --git a/abs/mv-core/MythVantage-config/systemconfig.sh b/abs/mv-core/MythVantage-config/systemconfig.sh
index 6971e8f..5884b69 100755
--- a/abs/mv-core/MythVantage-config/systemconfig.sh
+++ b/abs/mv-core/MythVantage-config/systemconfig.sh
@@ -1062,6 +1062,7 @@ then
then
echo "reloading network"
${BASE}/etc/net/scripts/network.init reload
+ ${BASE}/etc/net/scripts/network.init restart
else
echo "netboot/vnc, will not restart network"
fi