diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-09-10 13:41:21 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-09-10 13:41:21 +0000 |
commit | 228d6f9acbeaa85cfcb469d6d1d2cd5da7528926 (patch) | |
tree | 7e69114008d942a1b7521f6f448a61f5bab35855 | |
parent | 2cc504e1ea329ef49003cd6f71392b201bb4a9ba (diff) | |
download | pfsense-228d6f9acbeaa85cfcb469d6d1d2cd5da7528926.zip pfsense-228d6f9acbeaa85cfcb469d6d1d2cd5da7528926.tar.gz |
Bring up to more sane config.
-rw-r--r-- | etc/inc/interfaces.inc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 122f779..812673e 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -546,8 +546,13 @@ function interface_ppp_configure($ifcfg) { mwexec("kill {$pid}"); } - if ($ifcfg['pppif'] <> "") - mwexec("/sbin/ifconfig {$ifcfg['pppif']} destroy"); + $realif = $ifcfg['pppif']; + if ($g['booting'] || !(empty($realif))) { + mwexec("/sbin/ifconfig {$realif} destroy"); + mwexec("/sbin/ifconfig {$realif} create"); + } else + $realif = exec("/sbin/ifconfig ppp create"); + $peerfile = "lcp-echo-failure 0\n"; $peerfile .= "lcp-echo-interval 0\n"; @@ -572,7 +577,6 @@ function interface_ppp_configure($ifcfg) { //$peerfile .= "nodetach\n"; // KD - so I know where to look! $peerfile .= "# created by /etc/inc/interfaces.inc\n"; - file_put_contents("/etc/ppp/peers/ppp_{$dev}", $peerfile); // Added single quotes to some strings below: // the \rAT is *always* going to need it @@ -601,10 +605,14 @@ function interface_ppp_configure($ifcfg) { $chatfile .= "TIMEOUT 22 \\\n"; $chatfile .= "CONNECT \"\" \\\n"; $chatfile .= "SAY \"\\nConnected.\"\n"; + + config_lock(); + conf_mount_rw(); + file_put_contents("/etc/ppp/peers/ppp_{$dev}", $peerfile); file_put_contents("/etc/ppp/peers/ppp{$dev}-connect-chat", $chatfile); chmod("/etc/ppp/peers/ppp{$dev}-connect-chat", 0755); - - $realif = exec("/sbin/ifconfig ppp create"); + conf_mount_ro(); + config_unlock(); return $realif; } |