Add and use ppp-script

This commit is contained in:
Scott Ullrich 2009-10-26 00:25:44 -04:00
parent bb26581c50
commit 36bf235ee5
2 changed files with 10 additions and 5 deletions

View File

@ -898,7 +898,10 @@ function interface_ppp_configure($ifcfg) {
// Loop variables
$i = 0;
$startingip = 1;
// Start ppp.linkup file
$rclinkup = "default:\n";
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $ppp) {
$dev = substr($ppp['port'], 5);
@ -923,13 +926,12 @@ function interface_ppp_configure($ifcfg) {
$peerfile .= "\n";
$i++;
$startingip++;
$rclinkup.= "{$dev}:\n";
$rclinkup.= " ! sh -c \"/sbin/ppp-script HISADDR INTERFACE\"\n";
$rclinkup.= " ! sh -c \"/etc/rc.linkup INTERFACE start\"\n";
}
}
$rclinkup = "default:\n";
$rclinkup.= "! sh -c \"echo HISADDR > /tmp/INTERFACE_router\"\n";
$rclinkup.= "! sh -c \"/etc/rc.linkup INTERFACE start\"\n";
// Write out configuration for ppp.conf
file_put_contents("/etc/ppp/ppp.conf", $peerfile);

3
sbin/ppp-script Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
echo $1 > /tmp/${2}_router