summaryrefslogtreecommitdiff
path: root/scripts/vyatta-cfg-cmd-wrapper
diff options
context:
space:
mode:
authorMichael Larson <mike@ft1.vyatta.com>2009-09-09 16:26:01 -0700
committerMichael Larson <mike@ft1.vyatta.com>2009-09-09 16:26:01 -0700
commit5f1a33134d463fa565ee9dd43237252bd27d5fb3 (patch)
tree70f1ac5b1e76a0ae875c71ca15089ecdbc45c122 /scripts/vyatta-cfg-cmd-wrapper
parent028e8e12c5e15efc0a316641f2b02e46d5c77210 (diff)
parent42abfac6f11077dbfc3b0eaf845597e38f7cd685 (diff)
downloadvyatta-cfg-5f1a33134d463fa565ee9dd43237252bd27d5fb3.tar.gz
vyatta-cfg-5f1a33134d463fa565ee9dd43237252bd27d5fb3.zip
Merge branch 'kenwood' of http://git.vyatta.com/vyatta-cfg into kenwood
Diffstat (limited to 'scripts/vyatta-cfg-cmd-wrapper')
-rwxr-xr-xscripts/vyatta-cfg-cmd-wrapper26
1 files changed, 19 insertions, 7 deletions
diff --git a/scripts/vyatta-cfg-cmd-wrapper b/scripts/vyatta-cfg-cmd-wrapper
index 7496f96..53a3fcc 100755
--- a/scripts/vyatta-cfg-cmd-wrapper
+++ b/scripts/vyatta-cfg-cmd-wrapper
@@ -152,21 +152,33 @@ case "$1" in
RET_STATUS=$?
;;
load)
+ export vyatta_sysconfdir=/opt/vyatta/etc
+ export vyatta_sbindir=/opt/vyatta/sbin
/opt/vyatta/sbin/vyatta-load-config.pl "${@:2}"
RET_STATUS=$?
;;
- firewall-rule-rename)
- # this option is to be used for renaming firewall rules only
- # usage for this option specified on the next line -
- # firewall-rule-rename $firewall_ruleset rule $rule_num to rule $rename_rulenum
+ rule-rename)
+ # this option is to be used for renaming firewall and nat rules only
+ # usage for this option specified on the next two lines -
+ # rule-rename firewall $firewall_ruleset rule $rule_num to rule $rename_rulenum
+ # rule-rename nat rule $rule_num to rule $rename_rulenum
- VYATTA_TEMPLATE_LEVEL=/firewall/name/node.tag;
- VYATTA_EDIT_LEVEL="/firewall/name/$2";
+ if [ "$2" == "firewall" ]; then
+ VYATTA_TEMPLATE_LEVEL=/firewall/name/node.tag;
+ VYATTA_EDIT_LEVEL="/firewall/name/$3";
+ elif [ "$2" == "nat" ]; then
+ VYATTA_TEMPLATE_LEVEL=/service/nat;
+ VYATTA_EDIT_LEVEL=/service/nat;
+ fi
_mpath=${VYATTA_TEMP_CONFIG_DIR}/${VYATTA_EDIT_LEVEL}
_tpath=${VYATTA_CONFIG_TEMPLATE}/${VYATTA_TEMPLATE_LEVEL}
VYATTA_EDIT_LEVEL="${_mpath#$VYATTA_TEMP_CONFIG_DIR}/"
VYATTA_TEMPLATE_LEVEL="${_tpath#$VYATTA_CONFIG_TEMPLATE}/"
- mvcp rename Rename mv "${@:3}"
+ if [ $2 == "firewall" ]; then
+ mvcp rename Rename mv "${@:4}"
+ elif [ $2 == "nat" ]; then
+ mvcp rename Rename mv "${@:3}"
+ fi
RET_STATUS=$?
;;
*)