summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-activate-config.pl10
-rw-r--r--scripts/vyatta-comment-config.pl6
2 files changed, 10 insertions, 6 deletions
diff --git a/scripts/vyatta-activate-config.pl b/scripts/vyatta-activate-config.pl
index f7079ee..6bf6c3b 100644
--- a/scripts/vyatta-activate-config.pl
+++ b/scripts/vyatta-activate-config.pl
@@ -41,8 +41,8 @@ sub wanted_local {
sub check_parents {
my @p = @_;
- my $l_dir = "$ENV{VYATTA_TEMP_CONFIG_DIR}/";
- my $a_dir = "$ENV{VYATTA_ACTIVE_CONFIGURATION_DIR}/";
+ my $l_dir = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$ENV{VYATTA_EDIT_LEVEL}";
+ my $a_dir = "$ENV{VYATTA_ACTIVE_CONFIGURATION_DIR}/$ENV{VYATTA_EDIT_LEVEL}";
foreach my $sw (@p) {
$l_dir .= "/$sw";
$a_dir .= "/$sw";
@@ -80,7 +80,9 @@ foreach my $elem (@path) {
$elem =~ s/\s+/\//g;
$path[$i++] = $elem;
}
-my $path = join '/', @path;
+my $edit_level = "$ENV{VYATTA_EDIT_LEVEL}";
+
+my $path = $edit_level . join '/', @path;
my $full_path = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path";
@@ -96,7 +98,7 @@ if (-e $full_path) {
}
else {
#check if this is a leaf node with value
- my $parent_path_leaf = $ENV{VYATTA_TEMP_CONFIG_DIR} . "/" . join('/', @parent_path) . "/node.val";
+ my $parent_path_leaf = $ENV{VYATTA_TEMP_CONFIG_DIR} . "/" . $edit_level . join('/', @parent_path) . "/node.val";
if (-e $parent_path_leaf) {
#prevent setting on leaf or multi, check for node.val
if (!defined $ENV{BOOT}) {
diff --git a/scripts/vyatta-comment-config.pl b/scripts/vyatta-comment-config.pl
index ab3191e..8ef4cb6 100644
--- a/scripts/vyatta-comment-config.pl
+++ b/scripts/vyatta-comment-config.pl
@@ -42,12 +42,14 @@ foreach my $elem (@path) {
$elem =~ s/\s+/\//g;
$path[$i++] = $elem;
}
-my $path = join '/', @path;
+my $edit_level = "$ENV{VYATTA_EDIT_LEVEL}";
+
+my $path = $edit_level . join '/', @path;
my $full_path = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path";
if (! -e $full_path) {
- $path = join '/', @path[0..$#path-1];
+ $path = $edit_level . join '/', @path[0..$#path-1];
my $leaf = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path/node.val";
if (-e $leaf) {
$full_path = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path";