diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/miniupnpd/miniupnpd.inc | 36 |
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(); |