mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add and use ppp-script
This commit is contained in:
parent
bb26581c50
commit
36bf235ee5
@ -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
3
sbin/ppp-script
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo $1 > /tmp/${2}_router
|
||||
Loading…
Reference in New Issue
Block a user