From 177fff3b97ef16f85dcdfb28e17982a15256ddd3 Mon Sep 17 00:00:00 2001 From: Ryan Wagoner Date: Wed, 7 Feb 2007 02:48:56 +0000 Subject: correctly set the webgui url in miniupnpd --- packages/miniupnpd/miniupnpd.inc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'packages/miniupnpd/miniupnpd.inc') diff --git a/packages/miniupnpd/miniupnpd.inc b/packages/miniupnpd/miniupnpd.inc index ca73dbb6..f57787fb 100644 --- a/packages/miniupnpd/miniupnpd.inc +++ b/packages/miniupnpd/miniupnpd.inc @@ -147,10 +147,12 @@ /* check that the interface has an ip address before adding parameters */ if($addr) { $configtext .= "listening_ip={$addr}\n"; - if(!$ifaces_active) + if(!$ifaces_active) { + $webgui_ip = $addr; $ifaces_active = $iface; - else + } else { $ifaces_active .= ", {$iface}"; + } } else { upnp_warn("Interface {$iface} has no ip address, ignoring"); } @@ -187,6 +189,14 @@ if(upnp_config('sysuptime')) $configtext .= "system_uptime=yes\n"; + /* set webgui url */ + if($config['system']['webgui']['protocol']) { + $configtext .= "presentation_url=".$config['system']['webgui']['protocol']. "://{$webgui_ip}"; + if($config['system']['webgui']['port']) + $configtext .= ":".$config['system']['webgui']['port']; + $configtext .= "/\n"; + } + /* upnp access restrictions */ for($i=1; $i<=4; $i++) { if(upnp_config("permuser{$i}")) -- cgit v1.2.3