aboutsummaryrefslogtreecommitdiffstats
path: root/packages/miniupnpd/miniupnpd.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-08-19 23:47:05 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-08-19 23:47:05 +0000
commit59c55a355129fa1bd426d4443c042f9cae942cbf (patch)
treeb692201dabf9e20478ea8b70567d793728b28758 /packages/miniupnpd/miniupnpd.inc
parenta0865e6e3e13d009de513aa5994b44e370807d4d (diff)
downloadpfsense-packages-59c55a355129fa1bd426d4443c042f9cae942cbf.tar.gz
pfsense-packages-59c55a355129fa1bd426d4443c042f9cae942cbf.tar.bz2
pfsense-packages-59c55a355129fa1bd426d4443c042f9cae942cbf.zip
Add experimental upnp package
Diffstat (limited to 'packages/miniupnpd/miniupnpd.inc')
-rw-r--r--packages/miniupnpd/miniupnpd.inc36
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/miniupnpd/miniupnpd.inc b/packages/miniupnpd/miniupnpd.inc
new file mode 100644
index 00000000..11d556ff
--- /dev/null
+++ b/packages/miniupnpd/miniupnpd.inc
@@ -0,0 +1,36 @@
+<?php
+ /* Miniupnp */
+ function sync_package_miniupnpd() {
+ global $config;
+ global $input_errors;
+ conf_mount_rw();
+ config_lock();
+ $miniupnpd_config =&$_POST;
+ $if_final = "";
+ $ifaces_final = "";
+ $first = 0;
+ 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 {$if} -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_service("miniupnpd");
+ restart_service("miniupnpd");
+ config_unlock();
+ conf_mount_ro();
+ }
+?> \ No newline at end of file