aboutsummaryrefslogtreecommitdiffstats
path: root/packages/miniupnpd/miniupnpd.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-08-20 01:39:37 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-08-20 01:39:37 +0000
commit5d110f78fca6563cae645c6d1a7019358c0a449d (patch)
tree7c484f84c59d19ba9141b4cc01f233b1772351ee /packages/miniupnpd/miniupnpd.inc
parentd700d20ff3c25f776467a75c79672c5e36970010 (diff)
downloadpfsense-packages-5d110f78fca6563cae645c6d1a7019358c0a449d.tar.gz
pfsense-packages-5d110f78fca6563cae645c6d1a7019358c0a449d.tar.bz2
pfsense-packages-5d110f78fca6563cae645c6d1a7019358c0a449d.zip
Only parse items if user selects an interface
Diffstat (limited to 'packages/miniupnpd/miniupnpd.inc')
-rw-r--r--packages/miniupnpd/miniupnpd.inc36
1 files changed, 19 insertions, 17 deletions
diff --git a/packages/miniupnpd/miniupnpd.inc b/packages/miniupnpd/miniupnpd.inc
index 5641148d..06b1d8ea 100644
--- a/packages/miniupnpd/miniupnpd.inc
+++ b/packages/miniupnpd/miniupnpd.inc
@@ -10,25 +10,27 @@
$ifaces_final = "";
$first = 0;
$wanif = get_real_wan_interface();
- foreach($_POST['interface_array'] as $iface) {
- $if = convert_friendly_interface_to_real_interface_name($iface);
- if($if) {
- //if($first == 1)
- //$ifaces_final .= ",";
- $addr = find_interface_ip($if);
- $ifaces_final .= " -i {$wanif} -a {$addr}";
- $first = 1;
- } else {
- log_error("Could not resolve real interfaec {$iface}");
+ if(is_array($_POST['interface_array'])) {
+ foreach($_POST['interface_array'] as $iface) {
+ $if = convert_friendly_interface_to_real_interface_name($iface);
+ if($if) {
+ //if($first == 1)
+ //$ifaces_final .= ",";
+ $addr = find_interface_ip($if);
+ $ifaces_final .= " -i {$wanif} -a {$addr}";
+ $first = 1;
+ } else {
+ log_error("Could not resolve real interfaec {$iface}");
+ }
}
+ $start = "/usr/local/sbin/miniupnpd -p 2869{$ifaces_final}";
+ write_rcfile(array(
+ "file" => "miniupnpd.sh",
+ "start" => $start,
+ "stop" => "/usr/bin/killall miniupnpd"
+ )
+ );
}
- $start = "/usr/local/sbin/miniupnpd -p 2869{$ifaces_final}";
- write_rcfile(array(
- "file" => "miniupnpd.sh",
- "start" => $start,
- "stop" => "/usr/bin/killall miniupnpd"
- )
- );
start_service("miniupnpd");
restart_service("miniupnpd");
config_unlock();