map: export calculated ruleset to /tmp
authorSteven Barth <cyrus@openwrt.org>
Tue, 13 Jan 2015 19:00:39 +0000 (19:00 +0000)
committerSteven Barth <cyrus@openwrt.org>
Tue, 13 Jan 2015 19:00:39 +0000 (19:00 +0000)
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 43961

package/network/ipv6/map/Makefile
package/network/ipv6/map/files/map.sh

index 2848fe9ea28ac153044c145368922c0c6e5e3cfd..ed358defacc96c9d6ca2abcfd9ef62afcafc9422 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=map
 PKG_VERSION:=3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index 83de4cc4dc52d49413429ee702fb7b41dfa585fe..945accdebdb4f1d16551cfae0c4e0eea4a2aea5c 100755 (executable)
@@ -52,6 +52,7 @@ proto_map_setup() {
                fi
        fi
 
+       echo "rule=$rule" > /tmp/map-$cfg.rules
        RULE_DATA=$(mapcalc ${tunlink:-\*} $rule)
        if [ "$?" != 0 ]; then
                proto_notify_error "$cfg" "INVALID_MAP_RULE"
@@ -59,6 +60,7 @@ proto_map_setup() {
                return
        fi
 
+       echo "$RULE_DATA" >> /tmp/map-$cfg.rules
        eval $RULE_DATA
        
        if [ -z "$RULE_BMR" ]; then
@@ -188,6 +190,7 @@ proto_map_setup() {
 proto_map_teardown() {
        local cfg="$1"
        ifdown "${cfg}_local"
+       rm -f /tmp/map-$cfg.rules
 }
 
 proto_map_init_config() {