]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/scripts/connscheduler
Fixed conn scheduler restart collectd when morning reconnect (graphs)
[people/pmueller/ipfire-2.x.git] / src / scripts / connscheduler
index f513cf45d42e8f717f93c814013c05981065a28a..824af248abe6de932a017e3f00c048da931bcfa0 100644 (file)
@@ -63,6 +63,9 @@ exit 0;
 #
 sub hangup
 {
+  # Kill connectd if running to prevent redial
+  system('/bin/killall', 'connectd');
+
   unless ( -e "${General::swroot}/red/active" )
   {
     &General::log("ConnSched already disconnected");
@@ -76,11 +79,11 @@ sub hangup
     return;
   }
 
-  # now wait for active triggerfile and ppp daemon to disappear 
+  # now wait for active triggerfile and ppp daemon to disappear
   # wait maximum 60 seconds
   my $counter = 60;
   sleep 1;
-  while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 ) 
+  while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 )
   {
     sleep 1;
     $counter--;
@@ -120,12 +123,14 @@ sub reconnect
   # wait maximum 60 seconds
   my $counter = 60;
   sleep 1;
-  while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 ) 
+  while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 )
   {
     sleep 1;
     $counter--;
   }
+  /etc/init.d/collectd stop
   &dial();
+  /etc/init.d/collectd start
 }
 
 
@@ -165,7 +170,7 @@ sub profile
     ## FIXME: do we need to do this ?
     sleep($sleep_after_profile);
     &dial();
-  }  
+  }
 }
 
 
@@ -197,7 +202,7 @@ sub timer
     }
 
 
-    if ( $CONNSCHED::config[$i]{'ACTION'} eq 'reconnect' )    
+    if ( $CONNSCHED::config[$i]{'ACTION'} eq 'reconnect' )
     {
       &reconnect()
     }