aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-01-08 23:01:30 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-01-08 23:01:30 +0000
commit7316d403dfd4e1ff9b21a06591484f54da6da24f (patch)
treec36fd66de66ad40632aac185512422489c59b5ae
parent46b0bb3a97475f6b6ff52fcddc4ba6026d637eac (diff)
downloadpfsense-packages-7316d403dfd4e1ff9b21a06591484f54da6da24f.tar.gz
pfsense-packages-7316d403dfd4e1ff9b21a06591484f54da6da24f.tar.bz2
pfsense-packages-7316d403dfd4e1ff9b21a06591484f54da6da24f.zip
Allow multiple interfaces
-rw-r--r--packages/ntop/ntop.xml13
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/ntop/ntop.xml b/packages/ntop/ntop.xml
index f4dde982..1755332d 100644
--- a/packages/ntop/ntop.xml
+++ b/packages/ntop/ntop.xml
@@ -35,18 +35,27 @@
<fielddescr>Interface</fielddescr>
<fieldname>iface</fieldname>
<size>3</size>
- <multiselect>true</multiselect>
+ <multiple>true</multiple>
<type>interfaces_selection</type>
</field>
</fields>
<custom_add_php_command>
if($_POST['password'] == $_POST['passwordagain']) {
+ $interfaces = " -i ";
+ $ifaces=$_POST['iface'];
+ $isfirst = 0;
+ foreach($ifaces as $element=>$if)
+ {
+ if($isfirst == 1) $interfaces .= ",";
+ $interfaces .= $ifaces[$element];
+ $isfirst = 1;
+ }
system("/usr/local/bin/ntop --set-admin-password=" . $_POST['password']);
system("killall ntop 2>/dev/null");
system("rm /usr/local/etc/rc.d/ntop.sh");
$fout = fopen("/usr/local/etc/rc.d/ntop.sh","w");
fwrite($fout, "#!/bin/sh\n\n");
- fwrite($fout, "/usr/local/bin/ntop -i " . $_POST['iface'] . " -u root -d --ipv4 -M\n\n");
+ fwrite($fout, "/usr/local/bin/ntop " . $interfaces . " -u root -d --ipv4 -M\n\n");
fclose($fout);
system("chmod 555 /usr/local/etc/rc.d/ntop.sh");
system("/usr/local/etc/rc.d/ntop.sh");