[packages] miniupnpd: add option to enable NAT-PMP (#8747)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@25251 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2011-01-30 00:56:41 +00:00
parent 36f068af4a
commit b838faf06b
2 changed files with 11 additions and 7 deletions

View File

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=miniupnpd PKG_NAME:=miniupnpd
PKG_VERSION:=1.5 PKG_VERSION:=1.5
PKG_RELEASE:=4 PKG_RELEASE:=5
PKG_MD5SUM:=063f03a2a8363b9d4cb0f73b20b8dfce PKG_MD5SUM:=063f03a2a8363b9d4cb0f73b20b8dfce
PKG_SOURCE_URL:=http://miniupnp.free.fr/files PKG_SOURCE_URL:=http://miniupnp.free.fr/files

View File

@ -6,7 +6,7 @@ start() {
ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd
config_load "upnpd" config_load "upnpd"
local extiface intiface upload download logging secure enabled local extiface intiface upload download logging secure enabled natpmp
config_get extiface config external_iface config_get extiface config external_iface
config_get intiface config internal_iface config_get intiface config internal_iface
@ -14,6 +14,7 @@ start() {
config_get download config download config_get download config download
config_get_bool logging config log_output 0 config_get_bool logging config log_output 0
config_get_bool secure config secure_mode 0 config_get_bool secure config secure_mode 0
config_get_bool natpmp config enable_natpmp 0
config_get_bool enabled config enabled 0 config_get_bool enabled config enabled 0
include /lib/network include /lib/network
@ -40,11 +41,8 @@ start() {
[ "$secure" -gt 0 ] && \ [ "$secure" -gt 0 ] && \
append args "-S" append args "-S"
if [ "$logging" = "1" ]; then [ "$natpmp" -gt 0 ] && \
[ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args -d | logger -t miniupnpd & append args "-N"
else
[ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args 2>/dev/null
fi
# start firewall # start firewall
local zone local zone
@ -52,6 +50,12 @@ start() {
config_get zone core "${extiface:-wan}_zone" config_get zone core "${extiface:-wan}_zone"
[ -n "$zone" ] && \ [ -n "$zone" ] && \
miniupnpd_add_rules "$zone" "${extiface:-wan}" "$ifname" miniupnpd_add_rules "$zone" "${extiface:-wan}" "$ifname"
if [ "$logging" = "1" ]; then
[ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args -d | logger -t miniupnpd &
else
[ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args 2>/dev/null
fi
else else
logger -t "upnp daemon" "external interface not found, not starting" logger -t "upnp daemon" "external interface not found, not starting"
fi fi