Changeset 36011


Ignore:
Timestamp:
2013-03-14T16:30:58+01:00 (5 years ago)
Author:
jow
Message:

miniupnpd: rework and simplify firewall integration by taking advantage of the new fw3 functions

Location:
packages/net/miniupnpd
Files:
2 added
1 deleted
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • packages/net/miniupnpd/Makefile

    r35520 r36011  
    1010PKG_NAME:=miniupnpd 
    1111PKG_VERSION:=1.8 
    12 PKG_RELEASE:=1 
     12PKG_RELEASE:=2 
    1313 
    1414PKG_SOURCE_URL:=http://miniupnp.free.fr/files 
     
    3232endef 
    3333 
     34define Package/miniupnpd/postinst 
     35#!/bin/sh 
     36 
     37if [ -z "$$IPKG_INSTROOT" ]; then 
     38  . /etc/uci-defaults/99-miniupnpd 
     39  rm -f /etc/uci-defaults/99-miniupnpd 
     40fi 
     41 
     42exit 0 
     43endef 
     44 
    3445define Build/Prepare 
    3546        $(call Build/Prepare/Default) 
     
    4556 
    4657define Package/miniupnpd/install 
    47         $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/iface $(1)/etc/hotplug.d/firewall 
     58        $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/hotplug.d/iface $(1)/usr/share/miniupnpd 
    4859        $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/sbin/miniupnpd 
    4960        $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd 
    5061        $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd 
    51         $(INSTALL_DATA) ./files/miniupnpd.iface.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd 
    52         $(INSTALL_DATA) ./files/miniupnpd.firewall.hotplug $(1)/etc/hotplug.d/firewall/50-miniupnpd 
    53         $(INSTALL_DIR) $(1)/usr/share/miniupnpd 
     62        $(INSTALL_DATA) ./files/miniupnpd.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd 
     63        $(INSTALL_DATA) ./files/miniupnpd.defaults $(1)/etc/uci-defaults/99-miniupnpd 
     64        $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/miniupnpd/firewall.include 
    5465endef 
    5566 
  • packages/net/miniupnpd/files/miniupnpd.init

    r32057 r36011  
    6363 
    6464start() { 
    65         type miniupnpd_add_rules >/dev/null 2>/dev/null || \ 
    66                 ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd 
    67  
    6865        config_load "upnpd" 
    6966        local extiface intiface upload download logging secure enabled natpmp 
     
    166163        if [ -n "$ifname" ]; then 
    167164                # start firewall 
    168                 local zone 
    169                 config_load firewall 
    170                 config_get zone core "${extiface:-wan}_zone" 
    171  
    172             [ -n "$zone" ] && \ 
    173                         miniupnpd_add_rules "$zone" "${extiface:-wan}" "$ifname" 
     165                iptables -L MINIUPNPD >/dev/null 2>/dev/null || fw3 reload 
    174166 
    175167                if [ "$logging" = "1" ]; then 
     
    188180        service_stop /usr/sbin/miniupnpd 
    189181 
    190         type miniupnpd_remove_rules >/dev/null 2>/dev/null || \ 
    191                 ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd 
    192  
    193         miniupnpd_remove_rules 
    194  
    195182        iptables -t nat -F MINIUPNPD 2>/dev/null 
    196         iptables -t nat -X MINIUPNPD 2>/dev/null 
    197183        iptables -t filter -F MINIUPNPD 2>/dev/null 
    198         iptables -t filter -X MINIUPNPD 2>/dev/null 
    199184} 
Note: See TracChangeset for help on using the changeset viewer.