map: export calculated ruleset to /tmp

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 43961
lede-17.01
Steven Barth 2015-01-13 19:00:39 +00:00
parent 2b366700b0
commit 252bb0eeae
2 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=map PKG_NAME:=map
PKG_VERSION:=3 PKG_VERSION:=3
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@ -52,6 +52,7 @@ proto_map_setup() {
fi fi
fi fi
echo "rule=$rule" > /tmp/map-$cfg.rules
RULE_DATA=$(mapcalc ${tunlink:-\*} $rule) RULE_DATA=$(mapcalc ${tunlink:-\*} $rule)
if [ "$?" != 0 ]; then if [ "$?" != 0 ]; then
proto_notify_error "$cfg" "INVALID_MAP_RULE" proto_notify_error "$cfg" "INVALID_MAP_RULE"
@ -59,6 +60,7 @@ proto_map_setup() {
return return
fi fi
echo "$RULE_DATA" >> /tmp/map-$cfg.rules
eval $RULE_DATA eval $RULE_DATA
if [ -z "$RULE_BMR" ]; then if [ -z "$RULE_BMR" ]; then
@ -188,6 +190,7 @@ proto_map_setup() {
proto_map_teardown() { proto_map_teardown() {
local cfg="$1" local cfg="$1"
ifdown "${cfg}_local" ifdown "${cfg}_local"
rm -f /tmp/map-$cfg.rules
} }
proto_map_init_config() { proto_map_init_config() {