Revision 228d6f9a
Added by Ermal Luçi almost 17 years ago
etc/inc/interfaces.inc | ||
---|---|---|
546 | 546 |
mwexec("kill {$pid}"); |
547 | 547 |
} |
548 | 548 |
|
549 |
if ($ifcfg['pppif'] <> "") |
|
550 |
mwexec("/sbin/ifconfig {$ifcfg['pppif']} destroy"); |
|
549 |
$realif = $ifcfg['pppif']; |
|
550 |
if ($g['booting'] || !(empty($realif))) { |
|
551 |
mwexec("/sbin/ifconfig {$realif} destroy"); |
|
552 |
mwexec("/sbin/ifconfig {$realif} create"); |
|
553 |
} else |
|
554 |
$realif = exec("/sbin/ifconfig ppp create"); |
|
555 |
|
|
551 | 556 |
|
552 | 557 |
$peerfile = "lcp-echo-failure 0\n"; |
553 | 558 |
$peerfile .= "lcp-echo-interval 0\n"; |
... | ... | |
572 | 577 |
//$peerfile .= "nodetach\n"; |
573 | 578 |
// KD - so I know where to look! |
574 | 579 |
$peerfile .= "# created by /etc/inc/interfaces.inc\n"; |
575 |
file_put_contents("/etc/ppp/peers/ppp_{$dev}", $peerfile); |
|
576 | 580 |
|
577 | 581 |
// Added single quotes to some strings below: |
578 | 582 |
// the \rAT is *always* going to need it |
... | ... | |
601 | 605 |
$chatfile .= "TIMEOUT 22 \\\n"; |
602 | 606 |
$chatfile .= "CONNECT \"\" \\\n"; |
603 | 607 |
$chatfile .= "SAY \"\\nConnected.\"\n"; |
608 |
|
|
609 |
config_lock(); |
|
610 |
conf_mount_rw(); |
|
611 |
file_put_contents("/etc/ppp/peers/ppp_{$dev}", $peerfile); |
|
604 | 612 |
file_put_contents("/etc/ppp/peers/ppp{$dev}-connect-chat", $chatfile); |
605 | 613 |
chmod("/etc/ppp/peers/ppp{$dev}-connect-chat", 0755); |
606 |
|
|
607 |
$realif = exec("/sbin/ifconfig ppp create");
|
|
614 |
conf_mount_ro(); |
|
615 |
config_unlock();
|
|
608 | 616 |
|
609 | 617 |
return $realif; |
610 | 618 |
} |
Also available in: Unified diff
Bring up to more sane config.