From 8c3ef1f72923acce99cb632e663d6f8cef751c62 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sat, 13 Dec 2008 13:55:04 -0600
Subject: Add a delay and send more packets when checking the gw. The delay is
 needed  to give the interface time to fully init. closes FS#51

---
 abs/core-testing/LinHES-config/PKGBUILD         | 2 +-
 abs/core-testing/LinHES-config/install_proxy.sh | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index 543d182..6adba49 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=103
+pkgrel=104
 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/install_proxy.sh b/abs/core-testing/LinHES-config/install_proxy.sh
index e6b0976..195d7af 100755
--- a/abs/core-testing/LinHES-config/install_proxy.sh
+++ b/abs/core-testing/LinHES-config/install_proxy.sh
@@ -437,7 +437,7 @@ echo "-----------------------------------------------------------------------3--
                                 check_self)
                                             myipdefault=`ifconfig  | grep -C1 $default_interface| grep -v $default_interface | cut -d: -f2 | awk '{ print $1}'`
                                             echo "network check myself"
-                                            ifconfig 
+                                            ifconfig
                                             ping -c 1 $myipdefault
                                                     if [ ! $? = 0 ]
                                                     then
@@ -448,12 +448,13 @@ echo "-----------------------------------------------------------------------3--
                                 check_gw)
                                             #check gateway
                                             echo "network check gateway"
-                                            /sbin/route -n 
+                                            /sbin/route -n
                                             mygwdefault=`/sbin/route -n  |grep $default_interface|grep UG|awk '{ print $2}'`
                                             echo "Default gateway seems to be $mygwdefault"
 					                        if  [ !  x$mygwdefault = x ]
 					                        then
-	                                            ping -c 1 $mygwdefault
+                                                sleep 2
+	                                            ping -c 5 $mygwdefault
         	                                    if [ ! $? = 0 ]
                 	                            then
                         	                        exit 4
-- 
cgit v0.12


From 15f49f7b2cb3016c36b981641703b7a13951f28d Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sat, 13 Dec 2008 21:17:14 -0600
Subject: REF fs#50 Add hybrid of install/upgrade.   This is an install without
 formating /myth or xda3

To use this feature append clean_upgrade to the kernel boot parm & select upgrade for the install type.The upgrade will error out with "can't find old settings", continue past this prompt and a fresh install without formating /myth will occur.
---
 abs/core-testing/LinHES-config/PKGBUILD            |  2 +-
 abs/core-testing/LinHES-config/install_proxy.sh    | 86 ++++++++++++----------
 .../LinHES-config/restore_km_db_chroot.sh          |  1 -
 3 files changed, 48 insertions(+), 41 deletions(-)

diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index 6adba49..4be90e0 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=104
+pkgrel=109
 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/install_proxy.sh b/abs/core-testing/LinHES-config/install_proxy.sh
index 195d7af..92b90dc 100755
--- a/abs/core-testing/LinHES-config/install_proxy.sh
+++ b/abs/core-testing/LinHES-config/install_proxy.sh
@@ -67,7 +67,6 @@ function upgrade_mount_search {
     umount $mountpoint/myth
     mount $MYTH_P $mountpoint/myth
     return 0
-
 }
 
 
@@ -195,7 +194,7 @@ function upgrade () {
         $run mount_it $disk
         startsize=`statgrab -M disk.|grep $disk.write_bytes|cut -d= -f 2|tr -d " "`
         echo "STARTSIZE=$startsize">/tmp/.startsize.io
-        echo "Creating $hostname" > /tmp/.install_state
+        echo "Upgrading $hostname" > /tmp/.install_state
         sleep 1
         cp -rf /tmp/etc /new_boot/etc.old
         cp -rf  /tmp/oss /new_boot/var/lib/oss.old
@@ -210,7 +209,7 @@ function upgrade () {
         cp -fp /new_boot/etc.old/ssh/*.pub   /new_boot/etc/ssh/
         cp -fp /new_boot/etc.old/ssh/*.key   /new_boot/etc/ssh/
         cp -fp /new_boot/etc.old/ssh/*key   /new_boot/etc/ssh/
-
+        cp -fp /new_boot/etc.old/mdadm.conf /new_boot/etc/
         if [ ! -f /tmp/etc/KnoppMyth-version ]
         then
             #passwd/shadow/group
@@ -225,16 +224,14 @@ function upgrade () {
         fi
         $run fstab_fix_it $disk UPGRADE
 
-	#this is here to copy in the systemconfig file as soon as possible.
+	    #this is here to copy in the systemconfig file as soon as possible.
         cp -f /etc/systemconfig "$mountpoint"/etc
 
         echo "Writing boot sector" > /tmp/.install_state
         progress 99
         sleep 1
         $run grub_it $disk
-
-
-    echo "Configuring system" > /tmp/.install_state
+        echo "Configuring system" > /tmp/.install_state
         progress
         sleep 1
         cp /etc/mtab "$mountpoint"/etc/mtab
@@ -244,8 +241,9 @@ function upgrade () {
         then
             upgrade_mount_search
         fi
-
-        if [  -f /tmp/etc/KnoppMyth-version ]
+        echo $CMDLINE | grep -q clean_upgrade
+        status=$?
+        if [  -f /tmp/etc/KnoppMyth-version -o  $status = 0 ]
         then
             #run save syssettings to save settings, then copy to new mountpoint
             $MV_ROOT/bin/restore_default_settings.sh  -c save -t syssettings -h $MVHOSTNAME -d localhost
@@ -255,9 +253,14 @@ function upgrade () {
             chown root:mythtv "$mountpoint"/etc/systemconfig
             chown -R mythtv:mythtv ${mountpoint}$SE
             chmod -R 775   ${mountpoint}$SE
-            touch $mountpoint/home/mythtv/.kmupgrade && chmod 777 $mountpoint/home/mythtv/.kmupgrade
+            if [ ! $status = 0 ]
+            then
+                touch $mountpoint/home/mythtv/.kmupgrade && chmod 777 $mountpoint/home/mythtv/.kmupgrade
+            fi
         fi
 
+
+
         cp -f $MV_ROOT/bin/*.sh "$mountpoint"$MV_ROOT/bin/
         chmod -R 755 ${mountpoint}/root
         chown root:mythtv "$mountpoint"/etc/systemconfig
@@ -270,29 +273,41 @@ function upgrade () {
         #wrap this in a network check_network, no need to update the db if the import worked.
         #####  do I need to start mysql?
         /etc/rc.d/mysqld stop
-        if [ -f /new_boot/myth/backup/mythconverg.sql.gz ]
+        echo $CMDLINE | grep -q clean_upgrade
+        status=$?
+        if [ $status = 0 ]
         then
+        #new db as part of clean upgrade
             echo "--------------------------------"
-            echo "Restoring database"
-            echo "--------------------------------"
-            chroot "$mountpoint"   "$MV_ROOT/bin/restore_km_db_chroot.sh"  >  /tmp/chrootdb_km.out
-        else
-            echo "--------------------------------"
-            echo "Couldn't find backup file, installing new database"
+            echo "clean upgrade installing new database"
             echo "--------------------------------"
-            touch /tmp/.upgrade_db_failed
             chroot "$mountpoint"   "$MV_ROOT/bin/install_db_chroot.sh"  >  /tmp/chrootdb.out
+        else
+        #proceed as normal
+            if [ -f /new_boot/myth/backup/mythconverg.sql.gz ]
+            then
+                echo "--------------------------------"
+                echo "Restoring database"
+                echo "--------------------------------"
+                chroot "$mountpoint"   "$MV_ROOT/bin/restore_km_db_chroot.sh"  >  /tmp/chrootdb_km.out
+            else
+                echo "--------------------------------"
+                echo "Couldn't find backup file, installing new database"
+                echo "--------------------------------"
+                touch /tmp/.upgrade_db_failed
+                chroot "$mountpoint"   "$MV_ROOT/bin/install_db_chroot.sh"  >  /tmp/chrootdb.out
+            fi
         fi
 
 
         if [  -f /tmp/etc/KnoppMyth-version ]
         then
-            chroot "$mountpoint" $MV_ROOT/bin/restore_default_settings.sh -c restore -t hostsettings
+           chroot "$mountpoint" $MV_ROOT/bin/restore_default_settings.sh -c restore -t hostsettings
 	    #change permissions of /myth (only needed on km->linhes)
-	    chown -R mythtv:mythtv $mountpoint/myth
-            chown -R root:root $mountpoint/myth/backup
+	       chown -R mythtv:mythtv $mountpoint/myth
+           chown -R root:root $mountpoint/myth/backup
         else
-            chroot "$mountpoint" $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings
+           chroot "$mountpoint" $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings
         fi
         #
         #Run second time
@@ -300,8 +315,6 @@ function upgrade () {
         chroot "$mountpoint" $MV_ROOT/bin/systemconfig.sh advanced,this_is_install
         apply_new_auth
 
-
-
         umount "$mountpoint/dev"
         umount "$mountpoint/proc"
 
@@ -364,10 +377,14 @@ echo "-----------------------------------------------------------------------3--
          netboot-full_install   ;;
 
         find_update)
+
             #TRY TO mount first partition of drive
             #copy /etc/systemconfig to live,  import settings into db
             #umount drive
-            $run mount_it $disk
+            echo $CMDLINE | grep -q clean_upgrade
+            if [ $? = 1 ]
+            then
+                $run mount_it $disk
                 if [ -f /new_boot/etc/systemconfig ]
                 then
                 ###########ADD templates
@@ -378,10 +395,11 @@ echo "-----------------------------------------------------------------------3--
                     cp /new_boot/etc/systemconfig /etc/systemconfig
                     cp -rf  /new_boot/etc /tmp/etc
                     cp -rf /new_boot/var/lib/oss  /tmp/oss
-
+                    [ -e /tmp/etc/mdadm.conf ] && cp -rf /tmp/etc/mdadm.conf /etc/
                     $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings -h $MVHOSTNAME  -d 127.0.0.1
                 else
                     cp -rf  /new_boot/etc /tmp/etc
+                    [ -e /tmp/etc/mdadm.conf ] && cp -rf /tmp/etc/mdadm.conf /etc/
                     #now we search for the timezone and try to update
                     TZREGION=`cat /tmp/etc/timezone | cut -d"/" -f1`
                     TZSUB=`cat /tmp/etc/timezone | cut -d"/" -f2 -`
@@ -394,20 +412,13 @@ echo "-----------------------------------------------------------------------3--
                             $run update_db_it  HostTimeZoneRegion "$TZREGION"
                             $run update_db_it  HostTimeZoneRegion_$TZREGION "$TZSUB"
                     fi
-
-
-
                 fi
-
-
-
             $run umount_it $disk
+            fi
             ;;
 
         upgrade_it)
-                #"$MV_ROOT/bin/install_proxy.sh upgrade_it " + install_drive + " " + rootfs +  "&"
                 upgrade
-
             ;;
         disk_model_it)
                         model="unknown"
@@ -420,11 +431,8 @@ echo "-----------------------------------------------------------------------3--
                             s*)     model=`sginfo /dev/$2|grep Product|awk ' { print $2 } '`
                                     ;;
                         esac
-                                size=`parted /dev/$2  print |grep Disk|awk  ' { print $3 } '  `
-
-
-                                echo ""$model" $size " >/tmp/model
-
+                        size=`parted /dev/$2  print |grep Disk|awk  ' { print $3 } '  `
+                        echo ""$model" $size " >/tmp/model
             ;;
         network_check_it)
                         #Should never return from check_network
diff --git a/abs/core-testing/LinHES-config/restore_km_db_chroot.sh b/abs/core-testing/LinHES-config/restore_km_db_chroot.sh
index 17ad113..2f5ba72 100644
--- a/abs/core-testing/LinHES-config/restore_km_db_chroot.sh
+++ b/abs/core-testing/LinHES-config/restore_km_db_chroot.sh
@@ -35,7 +35,6 @@ if  [ $SystemType = "Master_backend" -o $SystemType = "Standalone"  ]
                         echo "restoring old database"
                         gunzip -c /myth/backup/mythconverg.sql.gz > /myth/backup/mythconverg.sql
                         mysql  mythconverg < /myth/backup/mythconverg.sql
-
                    else
                         echo "Could not restore old database, mythconverg.sql is missing."
                         touch /tmp/.upgrade_db_failed
-- 
cgit v0.12


From 6526e29a9d5425c0d294f7a376956b8440cb5631 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sun, 14 Dec 2008 10:25:54 -0600
Subject: if /myth/backup/mythconverg.sql is not present check for the file in
 /root/backup/

closes FS#60
---
 abs/core-testing/LinHES-config/PKGBUILD            |  2 +-
 abs/core-testing/LinHES-config/install_proxy.sh    | 23 +++++++++++++++++-----
 .../LinHES-config/restore_km_db_chroot.sh          |  8 ++++----
 3 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index 4be90e0..b76eb83 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=109
+pkgrel=114
 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/install_proxy.sh b/abs/core-testing/LinHES-config/install_proxy.sh
index 92b90dc..f251c70 100755
--- a/abs/core-testing/LinHES-config/install_proxy.sh
+++ b/abs/core-testing/LinHES-config/install_proxy.sh
@@ -14,6 +14,7 @@ run=$MV_ROOT/bin/install_functions.sh
 . /etc/systemconfig 2>/dev/null
 . $MV_ROOT/bin/networkconfig.sh
 CMDLINE=$(cat /proc/cmdline)
+BACKUPFILE="/myth/backup/mythconverg.sql.gz"
 
 #TEMPNET="Hostip"$default_interface
 #eval MYTHIP=\$${TEMPNET}
@@ -53,11 +54,13 @@ function apply_new_auth () {
 
 
 function backup_sql_check {
-
-    if [ -f $mountpoint/myth/backup/mythconverg.sql.gz ]
+    if [ -f ${mountpoint}${BACKUPFILE} ]
     then
+
+        echo "found ${mountpoint}${BACKUPFILE} "
         return 0
     else
+        echo "did not find ${mountpoint}${BACKUPFILE} "
         return 1
     fi
 }
@@ -66,6 +69,14 @@ function upgrade_mount_search {
     MYTH_P=`cat /tmp/etc/fstab |grep /myth| awk ' {print $1 '} `
     umount $mountpoint/myth
     mount $MYTH_P $mountpoint/myth
+    backup_sql_check
+    if [ $? = 1  ]
+    then
+        mkdir -p /new_boot/root/backup
+        cp -f /tmp/mythconverg.sql.gz  /new_boot/root/backup/mythconverg.sql.gz
+        BACKUPFILE="/root/backup/mythconverg.sql.gz"
+        echo "setting BACKUPFILE to $BACKUPFILE"
+    fi
     return 0
 }
 
@@ -237,7 +248,8 @@ function upgrade () {
         cp /etc/mtab "$mountpoint"/etc/mtab
         cp -f /etc/systemconfig "$mountpoint"/etc
 #make sure mythconverg.sql.gz is present
-        if [ ! backup_sql_check ]
+        backup_sql_check
+        if [ $? = 1 ]
         then
             upgrade_mount_search
         fi
@@ -284,12 +296,12 @@ function upgrade () {
             chroot "$mountpoint"   "$MV_ROOT/bin/install_db_chroot.sh"  >  /tmp/chrootdb.out
         else
         #proceed as normal
-            if [ -f /new_boot/myth/backup/mythconverg.sql.gz ]
+            if [ -f "$mountpoint"/$BACKUPFILE ]
             then
                 echo "--------------------------------"
                 echo "Restoring database"
                 echo "--------------------------------"
-                chroot "$mountpoint"   "$MV_ROOT/bin/restore_km_db_chroot.sh"  >  /tmp/chrootdb_km.out
+                chroot "$mountpoint"   "$MV_ROOT/bin/restore_km_db_chroot.sh" "$BACKUPFILE"  >  /tmp/chrootdb_km.out
             else
                 echo "--------------------------------"
                 echo "Couldn't find backup file, installing new database"
@@ -385,6 +397,7 @@ echo "-----------------------------------------------------------------------3--
             if [ $? = 1 ]
             then
                 $run mount_it $disk
+                [ -e "/new_boot/root/backup/mythconverg.sql.gz" ] && cp /new_boot/root/backup/mythconverg.sql.gz /tmp
                 if [ -f /new_boot/etc/systemconfig ]
                 then
                 ###########ADD templates
diff --git a/abs/core-testing/LinHES-config/restore_km_db_chroot.sh b/abs/core-testing/LinHES-config/restore_km_db_chroot.sh
index 2f5ba72..7ff6faf 100644
--- a/abs/core-testing/LinHES-config/restore_km_db_chroot.sh
+++ b/abs/core-testing/LinHES-config/restore_km_db_chroot.sh
@@ -30,11 +30,11 @@ if  [ $SystemType = "Master_backend" -o $SystemType = "Standalone"  ]
                    pacman --noconfirm -R mythdb-initial
                    pacman --noconfirm  -S mythdb-initial
 
-                   if [ -f /myth/backup/mythconverg.sql.gz ]
+                   if [ -f $DBFILE ]
                    then
                         echo "restoring old database"
-                        gunzip -c /myth/backup/mythconverg.sql.gz > /myth/backup/mythconverg.sql
-                        mysql  mythconverg < /myth/backup/mythconverg.sql
+                        gunzip -c $DBFILE > /tmp/mythconverg.sql
+                        mysql  mythconverg < /tmp/mythconverg.sql
                    else
                         echo "Could not restore old database, mythconverg.sql is missing."
                         touch /tmp/.upgrade_db_failed
@@ -47,7 +47,7 @@ if  [ $SystemType = "Master_backend" -o $SystemType = "Standalone"  ]
                 fi
             fi
         done
-        rm -f /myth/backup/mythconverg.sql
+        rm -f /tmp/mythconverg.sql
     else
         exit 0
     fi
-- 
cgit v0.12


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


From 717d0e9b4154c7d1d9c666072fddf94b16e08b68 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sun, 14 Dec 2008 13:21:58 -0600
Subject: Cleanup of networkconfig.sh Don't try to edit the options file if
 it's not present. closes FS#21

---
 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