summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-11-29 18:14:49 -0800
committerStig Thormodsrud <stig@vyatta.com>2010-11-29 18:14:49 -0800
commitda73f98b4dddf4b2168258e505af18839d003e2c (patch)
treef42e052efe1883a6b26d7bc4533250d2def8db50 /scripts
parent4e2ed49938b0c5d8de79e37683bcfca685388381 (diff)
downloadvyatta-cfg-da73f98b4dddf4b2168258e505af18839d003e2c.tar.gz
vyatta-cfg-da73f98b4dddf4b2168258e505af18839d003e2c.zip
Fix 6362: "show configuration cmds" actually returns set commands for saved config.boot instead of running config
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-config-gen-sets.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/vyatta-config-gen-sets.pl b/scripts/vyatta-config-gen-sets.pl
index be30477..1863edd 100755
--- a/scripts/vyatta-config-gen-sets.pl
+++ b/scripts/vyatta-config-gen-sets.pl
@@ -27,9 +27,15 @@ use strict;
use lib "/opt/vyatta/share/perl5/";
use Vyatta::ConfigLoad;
-my $conf_file = '/opt/vyatta/etc/config/config.boot';
-
-$conf_file = $ARGV[0] if defined $ARGV[0];
+my $conf_file;
+my $conf_tmp = "/tmp/config.boot.$$";
+
+if (defined $ARGV[0]) {
+ $conf_file = $ARGV[0];
+} else {
+ system("cli-shell-api showCfg --show-active-only > $conf_tmp");
+ $conf_file = $conf_tmp;
+}
# get a list of all config statement in the startup config file
my %cfg_hier = Vyatta::ConfigLoad::getStartupConfigStatements($conf_file);
@@ -49,7 +55,8 @@ foreach (@all_nodes) {
my $cmd = "set $path " . @$path_ref[($elements - 1)];
print "$cmd\n";
}
-print "commit\n";
+
+system("rm -f $conf_tmp") if $conf_file eq $conf_tmp;
exit 0;