From 0d020c8b938443ac8875bcfcff231dd1bf0d1d41 Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Wed, 5 May 2010 16:50:44 -0700 Subject: boot loader support now added. various bug fixes and some small rework. --- scripts/vyatta-cfg-cmd-wrapper | 8 ++++++++ scripts/vyatta-config-loader.pl | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vyatta-cfg-cmd-wrapper b/scripts/vyatta-cfg-cmd-wrapper index 93acd4f..3b2f040 100755 --- a/scripts/vyatta-cfg-cmd-wrapper +++ b/scripts/vyatta-cfg-cmd-wrapper @@ -212,6 +212,14 @@ case "$1" in /opt/vyatta/sbin/my_delete "${@:2}" RET_STATUS=$? ;; + deactivate) + /opt/vyatta/sbin/vyatta-activate-config.pl deactivate "${@:2}" + RET_STATUS=$? + ;; + activate) + /opt/vyatta/sbin/vyatta-activate-config.pl activate "${@:2}" + RET_STATUS=$? + ;; commit) # debug file /tmp/bar should be deleted before release /opt/vyatta/sbin/my_commit -a >> /tmp/bar diff --git a/scripts/vyatta-config-loader.pl b/scripts/vyatta-config-loader.pl index 61eafa5..7a3df2b 100755 --- a/scripts/vyatta-config-loader.pl +++ b/scripts/vyatta-config-loader.pl @@ -70,7 +70,16 @@ my $ret = 0; my $rank; #not used foreach (@all_nodes) { my ($path_ref, $rank) = @$_; - my $cmd = "$CWRAPPER set " . (join ' ', @$path_ref); + + my @pr = @$path_ref; + if (@pr[0] eq '!') { + @pr = @pr[1..$#pr]; + my $deactivate_cmd = "$CWRAPPER deactivate " . (join ' ', @pr) . " 1>/dev/null"; + system("$deactivate_cmd"); + #ignore these errors due to nesting warnings. + } + + my $cmd = "$CWRAPPER set " . (join ' ', @pr); # this debug file should be deleted before release system("echo [$cmd] >> /tmp/foo"); $ret = system("$cmd"); -- cgit v1.2.3