diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-10-07 20:32:06 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-10-07 20:32:06 +0000 |
commit | fdbf66d2810f301430b231609089d080dbbc5635 (patch) | |
tree | 9b6b46741f0f24b6f6572c21134e166931b61f87 /packages/miniupnpd/miniupnpd.inc | |
parent | a3944b39ff5624b0afe8a4ec74536065d4a8c893 (diff) | |
download | pfsense-packages-fdbf66d2810f301430b231609089d080dbbc5635.tar.gz pfsense-packages-fdbf66d2810f301430b231609089d080dbbc5635.tar.bz2 pfsense-packages-fdbf66d2810f301430b231609089d080dbbc5635.zip |
Apply changes suggested in http://forum.pfsense.org/index.php/topic,551.msg13610.html#msg13610
Diffstat (limited to 'packages/miniupnpd/miniupnpd.inc')
-rw-r--r-- | packages/miniupnpd/miniupnpd.inc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/miniupnpd/miniupnpd.inc b/packages/miniupnpd/miniupnpd.inc index ecd2fa10..d536253c 100644 --- a/packages/miniupnpd/miniupnpd.inc +++ b/packages/miniupnpd/miniupnpd.inc @@ -37,7 +37,9 @@ $start = "# Clear existing rules and rdr entries \n"; $start .= "/sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null\n"; $start .= "/sbin/pfctl -aminiupnpd -Fn 2>&1 >/dev/null\n"; - $start .= "killall miniupnpd; sleep 3; /usr/local/sbin/miniupnpd -p 2869{$ifaces_final}"; + $start .= "/usr/bin/killall miniupnpd\n"; + $start .= "while [ `ps -A | grep /usr/local/sbin/miniupnpd | grep -v grep | wc -l` != 0 ]; do sleep 1; done\n"; + $start .= "/usr/local/sbin/miniupnpd -p 2869{$ifaces_final}"; /* override wan ip address, common for carp, etc */ if($overridewanip) @@ -54,7 +56,13 @@ ) ); } + + /* if not ONE instance running lets start */ + /* or if $_POST data as user is changing settings */ + if((int)exec("ps -A | grep /usr/local/sbin/miniupnpd | grep -v grep | wc -l") != 1 || $_POST['interface_array']) { start_service("miniupnpd"); + } + config_unlock(); conf_mount_ro(); } |