]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/ppp/ip-down
BETA 1!
[ipfire-2.x.git] / src / ppp / ip-down
index 0d5e26deef4c70caf3f37ca6380d57d23e75c2a1..35ea4c8f2efeaa03029556aa7b2b81d7f46093b5 100644 (file)
@@ -1,33 +1,16 @@
-#!/usr/bin/perl
-#
-# SmoothWall CGIs
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) The SmoothWall Team
-#
-# $Id: ip-down,v 1.3.2.9 2005/01/26 12:23:26 riddles Exp $
+#!/bin/sh
 #
 
-use strict;
-require 'CONFIG_ROOT/general-functions.pl';
+. /etc/sysconfig/rc
+. $rc_functions
 
-&General::log("PPP has gone down on $ARGV[0]");
+eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings)
 
-umask 022;
+rm -f /var/ipfire/red/active
 
-unlink "${General::swroot}/red/active";
-system "/etc/rc.d/init.d/network red update";
+run_subdir ${rc_base}/init.d/networking/red.down/
 
-# Beep when ppp goes up or down. Silence if 'nobeeps' file exists.
-if ( ! -e "${General::swroot}/ppp/nobeeps") {
-       system('/usr/bin/beep','-l 75', '-f 880', '-n', '-l 75', '-f 440');
-}
+[ -e "/var/ipfire/ppp/nobeeps" ] || /etc/rc.d/init.d/beep down
 
-if ( -e "${General::swroot}/red/keepconnected") {
-       if ( system ('/bin/ps ax | /bin/grep -q "[r]c.connectioncheck reconnect"') ) {
-               system ('/etc/rc.d/init.d/connectioncheck reconnect &');
-       } else {
-               &General::log ('connectioncheck reconnect already running');
-       }
-}
+[ -e "/var/ipfire/red/keepconnected" ] && \
+               /etc/rc.d/init.d/connectd reconnect &