sync with r1585 from xwrt. kamikaze integration finished by thepeople. thanks
git-svn-id: svn://svn.openwrt.org/openwrt/packages@5692 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
83922c7260
commit
b95525d225
@ -37,10 +37,12 @@ define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/miniupnpd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config $(1)/CONTROL
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/*.sh $(1)/usr/bin/
|
||||
$(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd
|
||||
$(INSTALL_BIN) ./files/upnpd.config $(1)/etc/config/upnpd
|
||||
$(INSTALL_BIN) ./ipkg/miniupnp.postinst $(1)/CONTROL/postinst
|
||||
$(STRIP) $(1)/usr/bin/miniupnpd
|
||||
endef
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
upnpd_enabled=$(nvram get upnp_enabled)
|
||||
if [ "$upnpd_enabled" = "1" ]; then
|
||||
#!/bin/sh /etc/rc.common
|
||||
START=95
|
||||
start() {
|
||||
echo "miniupnpd starting ..."
|
||||
iptables_flush.sh 2>&- >&-
|
||||
killall miniupnpd 2>&-
|
||||
iptables_removeall.sh 2>&- >&-
|
||||
iptables_init.sh
|
||||
# get bitspeed information, if provided
|
||||
upnpd_up_bitspeed=$(nvram get upnpd_up_bitspeed)
|
||||
upnpd_down_bitspeed=$(nvram get upnpd_down_bitspeed)
|
||||
upnpd_up_bitspeed=$(uci get upnpd.general.up_bitspeed)
|
||||
upnpd_down_bitspeed=$(uci get upnpd.general.down_bitspeed)
|
||||
bitspeed_str=""
|
||||
[ -n "$upnpd_up_bitspeed" ] && [ -n "$upnpd_down_bitspeed" ] && {
|
||||
# covert to bytespeed
|
||||
@ -16,12 +16,15 @@ if [ "$upnpd_enabled" = "1" ]; then
|
||||
let upnpd_down_bytespeed=$upnpd_down_bitspeed*1024/8
|
||||
bitspeed_str="-B $upnpd_down_bytespeed $upnpd_up_bytespeed"
|
||||
}
|
||||
upnpd_log=$(nvram get upnpd_log_output)
|
||||
upnpd_log=$(uci get upnpd.general.log_output)
|
||||
if [ "$upnpd_log" = "1" ]; then
|
||||
miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U $bitspeed_str -d | logger -t miniupnpd &
|
||||
miniupnpd -i $(uci get network.wan.ifname) -a $(uci get network.lan.ipaddr) -p 5000 -U $bitspeed_str -d | logger -t miniupnpd &
|
||||
else
|
||||
miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U $bitspeed_str
|
||||
miniupnpd -i $(uci get network.wan.ifname) -a $(uci get network.lan.ipaddr) -p 5000 -U $bitspeed_str
|
||||
fi
|
||||
else
|
||||
echo "miniupnpd service is disabled. Set nvram upnp_enabled to '1' to enable."
|
||||
fi
|
||||
}
|
||||
stop() {
|
||||
iptables_flush.sh 2>&- >&-
|
||||
killall miniupnpd 2>&-
|
||||
iptables_removeall.sh 2>&- >&-
|
||||
}
|
4
net/miniupnpd/files/upnpd.config
Normal file
4
net/miniupnpd/files/upnpd.config
Normal file
@ -0,0 +1,4 @@
|
||||
config upnpd general
|
||||
option log_output '0'
|
||||
option down_bitspeed '1024'
|
||||
option up_bitspeed '512'
|
2
net/miniupnpd/ipkg/miniupnp.postinst
Normal file
2
net/miniupnpd/ipkg/miniupnp.postinst
Normal file
@ -0,0 +1,2 @@
|
||||
/etc/init.d/miniupnpd enable
|
||||
|
@ -7,7 +7,7 @@ diff -urN miniupnpd.orig/linux/iptables_init.sh miniupnpd/linux/iptables_init.sh
|
||||
|
||||
-#change this parameters :
|
||||
-EXTIF=eth0
|
||||
+EXTIF=$(nvram get wan_device)
|
||||
+EXTIF=$(uci get network.wan.ifname)
|
||||
EXTIP="`LC_ALL=C /sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"
|
||||
echo "External IP = $EXTIP"
|
||||
|
||||
@ -20,7 +20,7 @@ diff -urN miniupnpd.orig/linux/iptables_removeall.sh miniupnpd/linux/iptables_re
|
||||
|
||||
-#change this parameters :
|
||||
-EXTIF=eth0
|
||||
+EXTIF=$(nvram get wan_device)
|
||||
+EXTIF=$(uci get network.wan.ifname)
|
||||
EXTIP="`LC_ALL=C /sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"
|
||||
|
||||
#removing the MINIUPNPD chain for nat
|
||||
|
Loading…
x
Reference in New Issue
Block a user