From 6c3e0fd9ced2ccb23678de3c98c46b24b5e0467e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 4 Jan 2005 22:58:10 +0000 Subject: Add a new custom_php_resync_config_command sync directive which gets called after add or delete. Fix a number of small bugs discovered by: B.Kharazmi --- packages/pfstat.xml | 72 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 30 deletions(-) (limited to 'packages/pfstat.xml') diff --git a/packages/pfstat.xml b/packages/pfstat.xml index 927e3f4b..b025cea1 100644 --- a/packages/pfstat.xml +++ b/packages/pfstat.xml @@ -75,15 +75,19 @@ input - From + Update interval from input 1 1 + true - From Class + true + true + true + Update interval duration fromclassification select @@ -114,28 +118,28 @@ select - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -169,6 +173,8 @@ + + $fout = fopen("/usr/local/etc/pfstat.conf","w"); $leftgraphtext = ""; $rightgraphtext = ""; @@ -189,16 +195,22 @@ } foreach($config['installedpackages']['pfstat']['config'] as $pkgconfig) { fwrite($fout, "image \"/usr/local/www/pfstat/" . $pkgconfig['imagename'] ."\" { \n"); - fwrite($fout, "from " . $pkgconfig['from'] . " " . $pkgconfig['fromclassification'] . " to now \n"); + $from = $pkgconfig['from']; + if($from == "") $from = "30"; + fwrite($fout, "from " . $from . " " . $pkgconfig['fromclassification'] . " to now \n"); fwrite($fout, "width " . $pkgconfig['graphsizewidth'] . " height " . $pkgconfig['graphsizeheight'] . " \n"); - fwrite($fout, " left \n"); - fwrite($fout, " " . $leftgraphtext . "\n"); - fwrite($fout, " right \n"); - fwrite($fout, " " . $rightgraphtext . "\n"); + if($leftgraphtext != "") { + fwrite($fout, " left \n"); + fwrite($fout, " " . $leftgraphtext . "\n"); + } + if($rightgraphtext != "") { + fwrite($fout, " right \n"); + fwrite($fout, " " . $rightgraphtext . "\n"); + } fwrite($fout, "}\n\n"); } fclose($fout); - + system("mkdir -p /usr/local/www/pfstat 2>/dev/null"); system("/usr/bin/killall cron 2>/dev/null"); -- cgit v1.2.3