aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-07-16 19:35:43 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-07-16 19:35:43 +0000
commit1d0e71bd60ba7fab31dd43a40edcd3dcf5cc6c29 (patch)
tree24dfd4a2de10a001eadd7e2ce1e67ef5daeed2cb /packages
parentce3e5d8d155b1af96ddd64c10d16767de2dbe90c (diff)
downloadpfsense-packages-1d0e71bd60ba7fab31dd43a40edcd3dcf5cc6c29.tar.gz
pfsense-packages-1d0e71bd60ba7fab31dd43a40edcd3dcf5cc6c29.tar.bz2
pfsense-packages-1d0e71bd60ba7fab31dd43a40edcd3dcf5cc6c29.zip
Only call setup routines when needed
Diffstat (limited to 'packages')
-rw-r--r--packages/darkstat/darkstat.xml40
1 files changed, 24 insertions, 16 deletions
diff --git a/packages/darkstat/darkstat.xml b/packages/darkstat/darkstat.xml
index a2df94bb..723128f7 100644
--- a/packages/darkstat/darkstat.xml
+++ b/packages/darkstat/darkstat.xml
@@ -48,23 +48,31 @@
<executable>darkstat</executable>
</service>
<custom_php_global_functions>
- $first = 0;
- foreach($_POST['interface_array'] as $iface) {
- $if = convert_friendly_interface_to_real_interface_name($iface);
- if($if) {
- if($first == 1)
- $ifaces_final .= ",";
- $ifaces_final .= $if;
- $first = 1;
+ function sync_package_darkstat() {
+ $first = 0;
+ foreach($_POST['interface_array'] as $iface) {
+ $if = convert_friendly_interface_to_real_interface_name($iface);
+ if($if) {
+ if($first == 1)
+ $ifaces_final .= ",";
+ $ifaces_final .= $if;
+ $first = 1;
+ }
}
+ $start = "/usr/local/sbin/darkstat -i " . $ifaces_final . " -p 666 -d";
+ write_rcfile(array(
+ "file" => "darkstat.sh",
+ "start" => $start,
+ "stop" => "/usr/bin/killall darkstat"
+ )
+ );
+ restart_service("darkstat");
}
- $start = "/usr/local/sbin/darkstat -i " . $ifaces_final . " -p 666 -d";
- write_rcfile(array(
- "file" => "darkstat.sh",
- "start" => $start,
- "stop" => "/usr/bin/killall darkstat"
- )
- );
- restart_service("darkstat");
</custom_php_global_functions>
+ <custom_add_php_command>
+ sync_package_darkstat();
+ </custom_add_php_command>
+ <custom_php_resync_command>
+ sync_package_darkstat();
+ </custom_php_resync_command>
</packagegui>