aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-06-26 04:03:07 +0000
committerColin Smith <colin@pfsense.org>2005-06-26 04:03:07 +0000
commit66f4271c3439a4f385d85b4ab5c954445378ce69 (patch)
tree399c8e14623ed73165f0e7667d52ed71a6c3da43
parent64531d991a98a1bf8bd556e788bfbddb080f140f (diff)
downloadpfsense-packages-66f4271c3439a4f385d85b4ab5c954445378ce69.tar.gz
pfsense-packages-66f4271c3439a4f385d85b4ab5c954445378ce69.tar.bz2
pfsense-packages-66f4271c3439a4f385d85b4ab5c954445378ce69.zip
Modify arpwatch to use new service facilities.
-rw-r--r--packages/arpwatch.xml28
1 files changed, 15 insertions, 13 deletions
diff --git a/packages/arpwatch.xml b/packages/arpwatch.xml
index fffd5052..e09ee66e 100644
--- a/packages/arpwatch.xml
+++ b/packages/arpwatch.xml
@@ -11,6 +11,11 @@
<configfile>arpwatch.xml</configfile>
<url>/pkg_edit.php?xml=arpwatch.xml&amp;id=0</url>
</menu>
+ <service>
+ <name>arpwatch</name>
+ <rcfile>arpwatch.sh</rcfile>
+ <executable>arpwatch</executable>
+ </service>
<fields>
<field>
<fielddescr>Listening Interface</fielddescr>
@@ -27,25 +32,22 @@
conf_mount_rw();
config_lock();
global $config;
- $fout = fopen("/usr/local/etc/rc.d/arpwatch.sh","w");
- fwrite($fout, "#!/bin/sh\n\n");
- fwrite($fout, "# PACKAGE: Arpwatch\n");
- fwrite($fout, "# EXECUTABLE: arpwatch\n");
- fwrite($fout, "\n# This file was automatically generated by the pfSense\n# package management system.\n\n");
- if(isset($config['installedpackages']['arpwatch']['config'])) {
- $int = convert_friendly_interface_to_real_interface_name($config['installedpackages']['arpwatch']['config'][0]['interface']);
- fwrite($fout, "/usr/local/sbin/arpwatch -d -i " . $int . " &amp;\n\n");
- }
- chmod("/usr/local/etc/rc.d/arpwatch.sh", 0755);
- fclose($fout);
+ $int = convert_friendly_interface_to_real_interface_name($config['installedpackages']['arpwatch']['config'][0]['interface']);
+ $start = "/usr/local/sbin/arpwatch -d -i {$int} &amp;";
+ $stop = "/usr/bin/killall arpwatch";
+ write_rcfile(array(
+ "file" => "arpwatch.sh",
+ "start" => $start,
+ "stop" => $stop
+ )
+ );
+ start_service("arpwatch")
conf_mount_ro();
config_unlock();
}
</custom_php_global_functions>
<custom_add_php_command>
sync_package_arpwatch();
- mwexec("/usr/bin/killall -HUP arpwatch");
- mwexec("/usr/local/etc/rc.d/arpwatch.sh");
</custom_add_php_command>
</packagegui>