From 7d67cf7e9452baaaa38042112d8ed8f13e8daf90 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sun, 14 Dec 2008 10:47:02 -0600
Subject: Cleanup of networkconfig.sh Don't try to edit the options file if
 it's not present.

---
 abs/core-testing/LinHES-config/PKGBUILD         | 2 +-
 abs/core-testing/LinHES-config/networkconfig.sh | 7 +++++--
 abs/mv-core/MythVantage-config/networkconfig.sh | 8 ++++++--
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index b76eb83..68f88c9 100755
--- a/abs/core-testing/LinHES-config/PKGBUILD
+++ b/abs/core-testing/LinHES-config/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=LinHES-config
 pkgver=1.0
-pkgrel=114
+pkgrel=115
 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev )
 pkgdesc="Install and configure your system"
 depends=(bc libstatgrab  mysql-python expect curl dnsutils parted sg3_utils nmbscan )
diff --git a/abs/core-testing/LinHES-config/networkconfig.sh b/abs/core-testing/LinHES-config/networkconfig.sh
index 23e3774..5611265 100644
--- a/abs/core-testing/LinHES-config/networkconfig.sh
+++ b/abs/core-testing/LinHES-config/networkconfig.sh
@@ -51,8 +51,11 @@ function change_iface_state () {
             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
+            if [ -e $ETCNETDIR/$1/options ]
+            then
+                sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options
+                sed -i -e 's/^DISABLED=.*$/DISABLED=yes/g' $ETCNETDIR/$1/options
+            fi
             /sbin/ifconfig $1 down
             ip address flush $1
     fi
diff --git a/abs/mv-core/MythVantage-config/networkconfig.sh b/abs/mv-core/MythVantage-config/networkconfig.sh
index b4ffd5c..5611265 100644
--- a/abs/mv-core/MythVantage-config/networkconfig.sh
+++ b/abs/mv-core/MythVantage-config/networkconfig.sh
@@ -51,8 +51,11 @@ function change_iface_state () {
             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
+            if [ -e $ETCNETDIR/$1/options ]
+            then
+                sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options
+                sed -i -e 's/^DISABLED=.*$/DISABLED=yes/g' $ETCNETDIR/$1/options
+            fi
             /sbin/ifconfig $1 down
             ip address flush $1
     fi
@@ -262,6 +265,7 @@ 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
-- 
cgit v0.12