From be76c79376e4b8d068efe524aea2589800cd47aa Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 7 Jun 2005 20:49:23 +0000 Subject: Add UPNP package which helps with smelly^Wshotty software such as NetMeeting --- packages/upnpd.xml | 37 +++++++++++++++++++++++++++++++++++++ pkg_config.xml | 12 ++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 packages/upnpd.xml diff --git a/packages/upnpd.xml b/packages/upnpd.xml new file mode 100644 index 00000000..3821c336 --- /dev/null +++ b/packages/upnpd.xml @@ -0,0 +1,37 @@ + + + upnpd + 0.92_2 + + $lanif = $config['interfaces']['lan']['if']; + $wanif = get_real_wan_interface(); + $lanip = find_interface_ip($lanif); + /* copy original, we're going to overwrite !ADDR! with our internal ip */ + mwexec("cp /usr/local/etc/linuxigd/gatedesc.xml.bak /usr/local/etc/linuxigd/gatedesc.xml"); + /* replace !ADDR! with LAN ip */ + $file_contents = return_filename_as_string("/usr/local/etc/linuxigd/gatedesc.xml"); + $file_contents = str_replace("!ADDR!","{$lanip}",$file_contents); + $fout = fopen("/usr/local/etc/linuxigd/gatedesc.xml", "w"); + fwrite($fout, $file_contents); + fclose($fout); + /* write out custom rc.d starter script */ + $fout = fopen("/usr/local/etc/rc.d/upnpd.sh", "w"); + fwrite($fout, "#!/bin/sh\n# This package was automatically generated\n# by the pfSense package system.\n\n"); + fwrite($fout, "# PACKAGE: UPNPD\n"); + fwrite($fout, "# EXECUTABLE: upnpd\n\n"); + fwrite($fout, "/usr/local/bin/upnpd {$wanif} {$lanif}"); + fclose($fout); + chmod("/usr/local/etc/rc.d/upnpd.sh", 0755); + /* kill it off if its running */ + mwexec("killall upnpd"); + /* alright, thats all we need. start 'er up! */ + mwexec("/usr/local/etc/rc.d/upnpd.sh"); + + + /* we need to update the files !ADDR! from time to time which is the lan ip */ + mwexec("cp /usr/local/etc/linuxigd/gatedesc.xml /usr/local/etc/linuxigd/gatedesc.xml.bak"); + + + mwexec("rm /usr/local/etc/rc.d/upnpd.sh"); + + diff --git a/pkg_config.xml b/pkg_config.xml index f31ba885..81016e0c 100644 --- a/pkg_config.xml +++ b/pkg_config.xml @@ -224,6 +224,18 @@ test server or link availability and modify translation or routing rules. This p http://www.pfsense.com/packages/config/squid.xml squid.xml + + upnpd + + http://www.squid-cache.org/ + Network Management + http://ftp2.freebsd.org/pub/FreeBSD/ports/i386/packages-6-current/All + linuxigd-0.92_2.tbz + 0.92_2 + ALPHA ALPHA + http://www.pfsense.com/packages/config/upnpd.xml + squid.xml + -- cgit v1.2.3