summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-11-19 16:46:09 -0800
committerStig Thormodsrud <stig@vyatta.com>2010-11-19 16:46:09 -0800
commitb6ffe18307b08074439e83f91fcf700075d14d6c (patch)
tree2b9b030840058010ac8689086fd0be50c7fd989d /scripts
parentff8ff21ab7541b91f14dcc1777ad6e1173c43441 (diff)
downloadvyatta-cfg-b6ffe18307b08074439e83f91fcf700075d14d6c.tar.gz
vyatta-cfg-b6ffe18307b08074439e83f91fcf700075d14d6c.zip
Fix 6434: load asks to use 'commit' to make changes active even when nothing has changed
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-load-config.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index e85d802..c9094fd 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -277,6 +277,17 @@ foreach (@comment_list) {
#ignore error on complaint re: nested nodes
}
+my $tmp_config_file = "/tmp/config.boot.$$";
+my $tmp_config_file2 = "/tmp/config.boot2.$$";
+system("cli-shell-api showCfg --show-active-only > $tmp_config_file");
+system("cli-shell-api showCfg --show-working-only > $tmp_config_file2");
+my $diff = `diff -u $tmp_config_file $tmp_config_file2`;
+system("rm $tmp_config_file $tmp_config_file2");
+if (defined $diff and length($diff) < 1) {
+ print "No configuration changes to commit\n";
+ exit 0;
+}
+
my $load_merge = 'Load';
$load_merge = 'Merge' if $merge_mode eq 'true';
print "\n$load_merge complete. Use 'commit' to make changes active.\n";