diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-21 13:20:09 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-21 13:20:09 -0700 |
commit | 92189d2b84b4b9a6efa1b1d988d7b79aa4672680 (patch) | |
tree | 1262b98d95b3a9b904bb02cc200ab9c46bf37c76 /scripts | |
parent | 2fdc6b6ba23bd16307006115ddbb12f00c455a11 (diff) | |
download | vyatta-cfg-92189d2b84b4b9a6efa1b1d988d7b79aa4672680.tar.gz vyatta-cfg-92189d2b84b4b9a6efa1b1d988d7b79aa4672680.zip |
fix for bug 5708.
disallow leafs and multis from being deactivated in this release.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-activate-config.pl | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/vyatta-activate-config.pl b/scripts/vyatta-activate-config.pl index 47d91d7..6226f81 100644 --- a/scripts/vyatta-activate-config.pl +++ b/scripts/vyatta-activate-config.pl @@ -81,19 +81,18 @@ my $path = join '/', @path; my $full_path = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path"; -if (! -e $full_path) { - $path = join '/', @path[0..$#path-1]; - my $leaf = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path/node.val"; +if (-e $full_path) { + my $leaf = "$full_path/node.val"; if (-e $leaf) { #prevent setting on leaf or multi, check for node.val - printf("Cannot activate/deactivate end node\n"); - exit 1; - } - else { - printf("This command is not valid: $path\n"); + printf("Cannot deactivate end node\n"); exit 1; } } +else { + printf("This configuration element does not exist: " . join(' ', @path) . "\n"); + exit 1; +} ####################################################### #now check for nesting of the activate/deactivate nodes |