OSDN Git Service

Stop checking IP address on start to avoid fatal error.
[osdn-codes/ppp-resource-agents.git] / PPPConnection
index 936a702..a0466a1 100755 (executable)
@@ -176,15 +176,6 @@ ppp_start() {
       sleep $OCF_RESKEY_pon_wait_sec
     fi
   done
-  tries=0
-  while ! ppp_check_ip; do
-    tries=`expr $tries + 1`
-    sleep 1
-    if [ "$tries" -gt "$OCF_RESKEY_ip_wait_sec" ]; then
-      ocf_log err "Timeout to aquire expected IP address ${IP4} ${IP6}."
-      return $OCF_ERR_GENERIC
-    fi
-  done
   return $OCF_SUCCESS
 }
 
@@ -234,10 +225,16 @@ ppp_echo_status() {
     echo "disconnected"
     return 0
   fi
-  if ! ppp_check_ip; then
-    echo "connecting"
-    return 0
-  fi
+  tries=0
+  while ! ppp_check_ip; do
+    tries=`expr $tries + 1`
+    if [ "$tries" -gt "$OCF_RESKEY_ip_wait_sec" ]; then
+      ocf_log err "Timeout for waiting expected IP address (${IP4} ${IP6})."
+      echo "connecting"
+      return 0
+    fi
+    sleep 1
+  done
   echo "connected"
   return 0
 }