diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-02-21 04:33:30 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-02-21 04:33:30 +0000 |
commit | ac809adb4b893d0f5c877177ca0e495639719b2d (patch) | |
tree | 82c72b3d35c515a57034191c5c5f05c6a7a0668c /etc | |
parent | 3367ac0263c285a186f5f5724c75937844a27e8b (diff) | |
download | pfsense-ac809adb4b893d0f5c877177ca0e495639719b2d.zip pfsense-ac809adb4b893d0f5c877177ca0e495639719b2d.tar.gz |
* Add dynamic gateway polling time
* Fix interfaces
* Only edit olsr.conf and use one instance of program
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/services.inc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 0fe2a54..f5e9fcd 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -868,21 +868,21 @@ EOD; return 0; } -function setup_wireless_olsr($interface) { +function setup_wireless_olsr() { global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "setup_wireless_olsr($interface) being called $mt\n"; } foreach($config['installedpackages']['OLSRD']['config'] as $olsr) { - $fd = fopen("{$g['varetc_path']}/{$interface}_olsr.conf", "w"); + $fd = fopen("{$g['varetc_path']}/olsr.conf", "w"); $olsr .= <<<EODA # # olsr.org OLSR daemon config file # # Lines starting with a # are discarded # -# This file was shipped with olsrd 0.X.X +# This file was generated by setup_wireless_olsr() in services.inc # # This file is an example of a typical @@ -1072,7 +1072,7 @@ LoadPlugin "/usr/local/lib/olsrd_dyn_gw.so.0.4" { # how often to look for a inet gw, in seconds # defaults to 5 secs, if commented out - PlParam "Interval" "40" + PlParam "Interval" "{$olsr['polling']}" # if one or more IPv4 addresses are given, do a ping on these in # descending order to validate that there is not only an entry in @@ -1081,23 +1081,16 @@ LoadPlugin "/usr/local/lib/olsrd_dyn_gw.so.0.4" # succesful, i.e. if the ping on the 1st address was successful,the # 2nd won't be pinged PlParam "Ping" "{$olsr['ping']}" - #PlParam "Ping" "194.25.2.129" - #lParam "HNA" "192.168.80.0 255.255.255.0" #PlParam "HNA" "192.168.81.0 255.255.255.0" - #PlParam "Ping" "192.168.81.12" } EODE; } +foreach($config['installedpackages']['olsrd']['config'] as $config) { + foreach($config['interface_array'] as $interface) { $olsr .= <<<EOD -# Interfaces and their rules -# Omitted options will be set to the -# default values. Multiple interfaces -# can be specified in the same block -# and multiple blocks can be set. - Interface "{$interface}" { @@ -1166,11 +1159,15 @@ Interface "{$interface}" } + EOD; + + } +} fwrite($fd, $olsr); fclose($fd); } - mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/{$interface}_olsr.conf"); + mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/olsr.conf"); } ?>
\ No newline at end of file |