ifdepd
20050303
ifdepd: Settings
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
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");
fwrite($fout, "# PACKAGE: IFDepd\n");
fwrite($fout, "# EXECUTABLE: ifdepd\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();
}
unlink_if_exists("/usr/local/etc/rc.d/ifdepd.sh");
sync_package_ifdepd();
mwexec("/usr/bin/killall ifdepd");
mwexec("/usr/local/etc/rc.d/ifdepd.sh");
sync_package_ifdepd();