From 37f248df11efe3ba963a93d4a4d76c9d3e35ce89 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Mon, 21 Mar 2005 05:25:42 +0000 Subject: Add ifdepd package. --- packages/ifdepd.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 packages/ifdepd.xml diff --git a/packages/ifdepd.xml b/packages/ifdepd.xml new file mode 100644 index 00000000..2d195f76 --- /dev/null +++ b/packages/ifdepd.xml @@ -0,0 +1,63 @@ + + ifdepd + 20050303 + ifdepd: Settings + + ifdepd + Modify ifdepd settings. +
Services
+ ifdepd.xml + /pkg_edit.php?xml=ifdepd.xml&id=0 +
+ pkg_edit.php?xml=ifdepd.xml&id=0 + installedpackages->package->$packagename->configuration->settings + + + Use default values + usedefaults + If this is checked ifdepd will monitor the WAN and LAN interfaces for connectivity and will disable carp0 and carp1 upon their failure. + checkbox + + + Source interfaces + srcinterface + Enter a colon seperated list of interfaces to monitor for connectivity. You must use the physical interface names. + input + + + Destination interfaces + destinterface + Enter a colon seperated list of interfaces to disable once one of the source interfaces loses connectivity. You must specify physical interface names. + input + + + + unlink_if_exists("/usr/local/etc/rc.d/ifdep*"); + + + function sync_package_ifdepd() { + conf_mount_rw(); + config_lock(); + global $config; + if ($_POST[0] == "") $_POST = $config['installedpackages']['ifdepd']['config']; + if($config['installedpackages']['ifdepd']['config'] != "") { + $fout = fopen("/usr/local/etc/rc.d/ifdepd.sh","w"); + fwrite($fout, "#!/bin/sh\n\n"); + if(isset($_POST['usedefaults'])) { + $lan_int = $config['interfaces']['lan']['if']; + $wan_int = $config['interfaces']['wan']['if']; + fwrite($fout, "/usr/local/bin/ifdepd -d -S " . $lan_int . ":" . $wan_int . " -D carp0:carp1\n"); + } else { + fwrite($fout, "/usr/local/bin/ifdepd -d -S " . $_POST['srcinterface'] . " -D " . $_POST['destinterface'] . "\n"); + } + fclose($fout); + } + conf_mount_ro(); + config_unlock(); + } + sync_package_ifdepd(); + mwexec("/usr/bin/killall ifdepd"); + mwexec("/usr/local/etc/rc.d/ifdepd.sh"); + +
+ -- cgit v1.2.3