diff options
-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 |