]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/ppp/ip-down
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@31 ea5c0bd1-69bd-2848...
[people/teissler/ipfire-2.x.git] / src / ppp / ip-down
1 #!/usr/bin/perl
2 #
3 # SmoothWall CGIs
4 #
5 # This code is distributed under the terms of the GPL
6 #
7 # (c) The SmoothWall Team
8 #
9 # $Id: ip-down,v 1.3.2.9 2005/01/26 12:23:26 riddles Exp $
10 #
11
12 use strict;
13 require 'CONFIG_ROOT/general-functions.pl';
14
15 &General::log("PPP has gone down on $ARGV[0]");
16
17 umask 022;
18
19 unlink "${General::swroot}/red/active";
20 system "/etc/rc.d/rc.updatered";
21
22 # Beep when ppp goes up or down. Silence if 'nobeeps' file exists.
23 if ( ! -e "${General::swroot}/ppp/nobeeps") {
24 system('/usr/bin/beep','-l 75', '-f 880', '-n', '-l 75', '-f 440');
25 }
26
27 if ( -e "${General::swroot}/red/keepconnected") {
28 if ( system ('/bin/ps ax | /bin/grep -q "[r]c.connectioncheck reconnect"') ) {
29 system ('/etc/rc.d/rc.connectioncheck reconnect &');
30 } else {
31 &General::log ('rc.connectioncheck reconnect already running');
32 }
33 }