From 616465510ef187a206fc1858234b8558c3bc2f35 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Sat, 4 Dec 2010 13:40:06 -0800 Subject: Set COMMIT_VIA for initial commit-revisions setup. --- scripts/vyatta-config-mgmt.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/vyatta-config-mgmt.pl b/scripts/vyatta-config-mgmt.pl index 382b685..b57db0e 100755 --- a/scripts/vyatta-config-mgmt.pl +++ b/scripts/vyatta-config-mgmt.pl @@ -218,13 +218,13 @@ if ($action eq 'update-revs') { $lr_conf .= "}\n"; cm_write_file($lr_conf_file, $lr_conf); my $num_revs = cm_get_num_revs(); - if ($num_revs == 0) { + if (! -e "$archive_dir/commits" or $num_revs == 0) { # store a baseline config system("sudo touch $archive_dir/commits"); system("sudo chgrp vyattacfg $archive_dir/commits"); system("sudo chmod 664 $archive_dir/commits"); my $cmd = "$commit_revs_script baseline config.boot"; - system("sudo sg vyattacfg \"$cmd\""); + system("sudo sg vyattacfg \"export COMMIT_VIA=init; $cmd\""); } exit 0; } -- cgit v1.2.3