summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-07-31 15:08:30 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-07-31 15:08:30 -0700
commitc25cec88d97a4dbb0e04a45d620f7e4c9796e02d (patch)
tree1f0aad67603e7f461f7550a16a010c8bcd445307 /scripts
parent9c2f8965e28bd4af5f8773b85dbee0511f447ec3 (diff)
parent362e4280979ad499fc9662023761250ac24e02aa (diff)
downloadvyatta-cfg-c25cec88d97a4dbb0e04a45d620f7e4c9796e02d.tar.gz
vyatta-cfg-c25cec88d97a4dbb0e04a45d620f7e4c9796e02d.zip
Merge branch 'kenwood' of http://git.vyatta.com/vyatta-cfg into kenwood
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-cfg-cmd-wrapper24
-rwxr-xr-xscripts/vyatta-cli-expand-var.pl2
-rwxr-xr-xscripts/vyatta-load-config.pl2
3 files changed, 19 insertions, 9 deletions
diff --git a/scripts/vyatta-cfg-cmd-wrapper b/scripts/vyatta-cfg-cmd-wrapper
index 8a73d17..53a3fcc 100755
--- a/scripts/vyatta-cfg-cmd-wrapper
+++ b/scripts/vyatta-cfg-cmd-wrapper
@@ -157,18 +157,28 @@ case "$1" in
/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=$?
;;
*)
diff --git a/scripts/vyatta-cli-expand-var.pl b/scripts/vyatta-cli-expand-var.pl
index f690f0b..f3bda2d 100755
--- a/scripts/vyatta-cli-expand-var.pl
+++ b/scripts/vyatta-cli-expand-var.pl
@@ -34,7 +34,7 @@ $_ = $ARGV[0];
# basic format check:
# '(' ')' not allowed in reference.
# only allow absolute path for now.
-if (!/^\$\(\/([^()]+)\)$/) {
+if (!/^\$VAR\(\/([^()]+)\)$/) {
print STDERR "invalid variable reference (invalid format)\n";
exit 1;
}
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index a3cf6ef..f0dbaf1 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -175,7 +175,7 @@ syslog( "warning", "Load config [$orig_load_file] by $login" );
# do config migration
system("$sbindir/vyatta_config_migrate.pl $load_file");
-print "Loading config file $load_file...\n";
+print "Loading configuration from '$load_file'...\n";
my %cfg_hier = Vyatta::ConfigLoad::loadConfigHierarchy($load_file,$merge);
if ( scalar( keys %cfg_hier ) == 0 ) {
print "The specified file does not contain any configuration.\n";