]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/ppp/ip-up
5 # This code is distributed under the terms of the GPL
7 # (c) The SmoothWall Team
9 # $Id: ip-up,v 1.3.2.3 2005/01/26 12:23:26 riddles Exp $
13 require 'CONFIG_ROOT/general-functions.pl';
15 &General
::log("PPP has gone up on $ARGV[0]");
20 # read vars back from file.
21 &General
::readhash
("${General::swroot}/ppp/settings", \
%pppsettings);
23 if ( ( $pppsettings{'TYPE'} eq 'isdn') &&
24 ( $pppsettings{'COMPORT'} eq 'isdn2') &&
25 ( $pppsettings{'USEIBOD'} eq 'off') ) {
26 system('/usr/sbin/isdnctrl', 'dial', 'ippp1');
29 my $dns = $pppsettings{'DNS'};
30 my $primarydns = $pppsettings{'DNS1'};
31 my $secondarydns = $pppsettings{'DNS2'};
32 if ($dns eq 'Automatic') {
33 if (!($pppsettings{'TYPE'} =~ /^isdn/))
35 if (open(FILE
, ">${General::swroot}/red/dns1")) { print FILE
$ENV{'DNS1'}; close FILE
; }
36 if (open(FILE
, ">${General::swroot}/red/dns2")) { print FILE
$ENV{'DNS2'}; close FILE
; }
40 if (open(FILE
, ">${General::swroot}/red/dns1")) { print FILE
$ENV{'MS_DNS1'}; close FILE
; }
41 if (open(FILE
, ">${General::swroot}/red/dns2")) { print FILE
$ENV{'MS_DNS2'}; close FILE
; }
44 if (open(FILE
, ">${General::swroot}/red/dns1")) { print FILE
$pppsettings{'DNS1'}; close FILE
; }
45 if (open(FILE
, ">${General::swroot}/red/dns2")) { print FILE
$pppsettings{'DNS2'}; close FILE
; }
48 if (open(FILE
, ">${General::swroot}/red/iface")) { print FILE
$ARGV[0]; close (FILE
); }
49 if (open(FILE
, ">${General::swroot}/red/local-ipaddress")) { print FILE
$ARGV[3]; close (FILE
); }
50 if (open(FILE
, ">${General::swroot}/red/remote-ipaddress")) { print FILE
$ARGV[4]; close (FILE
); }
52 system('/bin/touch', "${General::swroot}/red/active");
53 system('/etc/rc.d/rc.updatered');
55 # Beep when ppp goes up or down. Silence if 'nobeeps' file exists.
56 if ( ! -e
"${General::swroot}/ppp/nobeeps") {
57 system "/bin/echo -en '\a' >/dev/console";