ext-sources/gnome-system-tools-network-admin.ksh
changeset 13776 895a6b9270c5
parent 13388 949d08fbd0ea
child 14507 5e590640f3db
--- a/ext-sources/gnome-system-tools-network-admin.ksh	Fri Sep 26 10:36:09 2008 +0000
+++ b/ext-sources/gnome-system-tools-network-admin.ksh	Fri Sep 26 13:26:01 2008 +0000
@@ -58,12 +58,12 @@
 
     # Try svcadm directly, use might have sufficient auths.
     switch_completed=false
-    if pfexec -P all svcadm disable "${NET_PHYSICAL_SVC}:${to_disable}" 2>/dev/null; then
-        if pfexec -P all svcadm enable "${NET_PHYSICAL_SVC}:${to_enable}" 2>/dev/null; then
+    if pfexec -P all svcadm disable -s "${NET_PHYSICAL_SVC}:${to_disable}" 2>/dev/null; then
+        if pfexec -P all svcadm enable -s "${NET_PHYSICAL_SVC}:${to_enable}" 2>/dev/null; then
             switch_completed=true
         else 
             # Restore to previous state.
-            pfexec -P all svcadm enable "${NET_PHYSICAL_SVC}:${to_disable}" 2>/dev/null
+            pfexec -P all svcadm enable -s "${NET_PHYSICAL_SVC}:${to_disable}" 2>/dev/null
         fi
     fi
 
@@ -72,12 +72,12 @@
         TMPFILE=${APP_TMP_DIR}/switch_to_${1}.$$.sh
         cat > ${TMPFILE} <<_EOF
 #!/bin/sh
-    if svcadm disable "${NET_PHYSICAL_SVC}:${to_disable}"; then
-        if svcadm enable "${NET_PHYSICAL_SVC}:${to_enable}"; then
+    if svcadm disable -s "${NET_PHYSICAL_SVC}:${to_disable}"; then
+        if svcadm enable -s "${NET_PHYSICAL_SVC}:${to_enable}"; then
             :
         else 
             # Restore to previous state
-            svcadm enable "${NET_PHYSICAL_SVC}:${to_disable}"
+            svcadm enable -s "${NET_PHYSICAL_SVC}:${to_disable}"
         fi
     fi
 _EOF
@@ -86,9 +86,8 @@
     fi
 
     #Check to see if we successfully completed all tasks.
-
+    sleep 3 # Slight delay to give SMF time to switch.
     if [ "${to_enable}" = "nwam" ]; then
-        sleep 3 # Give SMF time to start NWAM
         if isRunningNWAM; then
             rval=0
         else