mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
pppsetup.cgi: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
4abd5cd00e
commit
1366526c0b
@@ -39,6 +39,8 @@ my %checked=();
|
|||||||
my @profilenames=();
|
my @profilenames=();
|
||||||
my $errormessage = '';
|
my $errormessage = '';
|
||||||
my $maxprofiles = 5;
|
my $maxprofiles = 5;
|
||||||
|
|
||||||
|
# This call is safe, because no user input will be processed.
|
||||||
my $kernel=`/bin/uname -r | /usr/bin/tr -d '\012'`;
|
my $kernel=`/bin/uname -r | /usr/bin/tr -d '\012'`;
|
||||||
|
|
||||||
my %color = ();
|
my %color = ();
|
||||||
@@ -177,7 +179,12 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'})
|
|||||||
$errormessage = $Lang::tr{'invalid input'};
|
$errormessage = $Lang::tr{'invalid input'};
|
||||||
goto ERROR; }
|
goto ERROR; }
|
||||||
|
|
||||||
if( $pppsettings{'RECONNECTION'} eq 'dialondemand' && `/bin/cat ${General::swroot}/ddns/config` =~ /,on$/m ) {
|
# Read-in ddns config file, to check if at least one provider is enabled.
|
||||||
|
open(FILE, "${General::swroot}/ddns/config)";
|
||||||
|
my @ddns_config = <FILE>
|
||||||
|
close(FILE);
|
||||||
|
|
||||||
|
if( $pppsettings{'RECONNECTION'} eq 'dialondemand' && grep(/on/, @ddns_config) ) {
|
||||||
$errormessage = $Lang::tr{'dod not compatible with ddns'};
|
$errormessage = $Lang::tr{'dod not compatible with ddns'};
|
||||||
goto ERROR; }
|
goto ERROR; }
|
||||||
|
|
||||||
@@ -520,7 +527,12 @@ print <<END
|
|||||||
END
|
END
|
||||||
;
|
;
|
||||||
|
|
||||||
my $atmdev=`cat /proc/net/atm/devices 2>/dev/null | grep 0`;
|
# Read-in atm devices from proc.
|
||||||
|
open(PROC, "/proc/net/atm/devices");
|
||||||
|
my @patm_devices = <PROC>;
|
||||||
|
close(PROC);
|
||||||
|
|
||||||
|
my $atmdev = grep(/0/, @atm_devices);
|
||||||
chomp ($atmdev);
|
chomp ($atmdev);
|
||||||
if ($atmdev ne '') {
|
if ($atmdev ne '') {
|
||||||
print <<END
|
print <<END
|
||||||
@@ -962,7 +974,10 @@ sub updatesettings
|
|||||||
unlink("${General::swroot}/ppp/settings");
|
unlink("${General::swroot}/ppp/settings");
|
||||||
link("${General::swroot}/ppp/settings-$pppsettings{'PROFILE'}",
|
link("${General::swroot}/ppp/settings-$pppsettings{'PROFILE'}",
|
||||||
"${General::swroot}/ppp/settings");
|
"${General::swroot}/ppp/settings");
|
||||||
&General::system("/usr/bin/touch", "${General::swroot}/ppp/updatesettings");
|
|
||||||
|
# Write updatesettings file.
|
||||||
|
open(FILE, ">/${General::swroot}/ppp/updatesettings");
|
||||||
|
close(FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub writesecrets
|
sub writesecrets
|
||||||
|
|||||||
Reference in New Issue
Block a user