diff options
author | Colin Smith <colin@pfsense.org> | 2005-06-26 16:58:29 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-06-26 16:58:29 +0000 |
commit | e5bcff6ae7fdc7b8a843626da7208f3831347bc4 (patch) | |
tree | c87587d6b2f57d77cc0ed80e457c3db8ed8d7963 /packages | |
parent | 90ff9389a073d7e608371c7938869ab47a5cb3b2 (diff) | |
download | pfsense-packages-e5bcff6ae7fdc7b8a843626da7208f3831347bc4.tar.gz pfsense-packages-e5bcff6ae7fdc7b8a843626da7208f3831347bc4.tar.bz2 pfsense-packages-e5bcff6ae7fdc7b8a843626da7208f3831347bc4.zip |
Use services.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/ifdepd.xml | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/packages/ifdepd.xml b/packages/ifdepd.xml index 6d309251..45aa80f0 100644 --- a/packages/ifdepd.xml +++ b/packages/ifdepd.xml @@ -9,6 +9,11 @@ <configfile>ifdepd.xml</configfile> <url>/pkg_edit.php?xml=ifdepd.xml&id=0</url> </menu> + <service> + <name>ifdepd</name> + <rcfile>ifdepd.sh</rcfile> + <executable>ifdepd</executable> + </service> <configpath>installedpackages->package->$packagename->configuration->settings</configpath> <fields> <field> @@ -35,19 +40,22 @@ conf_mount_rw(); config_lock(); global $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'])) { + $ifdepd_config =& $config['installedpackages']['ifdepd']['config']; + if($ifdepd_config != "") { + if(isset($ifdepd_config['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"); + $start = "/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"); + $start = "/usr/local/bin/ifdepd -d -S " . $ifdepd_config['srcinterface'] . " -D " . $_POST['destinterface'] . "\n"); } - fclose($fout); + write_rcfile(array( + "file" => "ifdepd.sh", + "start" => $start, + "stop" => "/usr/bin/killall ifdepd" + ) + ); + restart_service("ifdepd"); } conf_mount_ro(); config_unlock(); |