diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-cfg-cmd-wrapper | 2 | ||||
-rwxr-xr-x | scripts/vyatta-save-config.pl | 19 |
2 files changed, 14 insertions, 7 deletions
diff --git a/scripts/vyatta-cfg-cmd-wrapper b/scripts/vyatta-cfg-cmd-wrapper index e04faeb..2d22235 100755 --- a/scripts/vyatta-cfg-cmd-wrapper +++ b/scripts/vyatta-cfg-cmd-wrapper @@ -71,7 +71,7 @@ case "$1" in RET_STATUS=$? ;; show) - /opt/vyatta/sbin/vyatta-output-config.pl + ${vyatta_sbindir}/my_cli_shell_api showCfg RET_STATUS=$? ;; comment) diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl index cebdf96..a9b5779 100755 --- a/scripts/vyatta-save-config.pl +++ b/scripts/vyatta-save-config.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Author: An-Cheng Huang <ancheng@vyatta.com> +# Author: Vyatta <eng@vyatta.com> # Date: 2007 # Description: script to save the configuration @@ -29,7 +29,7 @@ my $bootpath = $etcdir . "/config"; my $save_file = $bootpath . "/config.boot"; my $url_tmp_file = $bootpath . "/config.boot.$$"; -my $set_show_opt = 1; +my $show_default = 1; if ($#ARGV > 1) { print "Usage: save [config_file_name] --no-defaults\n"; exit 1; @@ -41,11 +41,11 @@ if (defined($ARGV[0])) { $save_file = $ARGV[0]; } else { - $set_show_opt = 0; + $show_default = 0; } if (defined($ARGV[1]) && $ARGV[1] eq '--no-defaults') { - $set_show_opt = 0; + $show_default = 0; } } @@ -100,8 +100,15 @@ if ($mode eq 'local') { } select $save; -set_show_all($set_show_opt); -outputActiveConfig(); +my @show_cmd = ('cli-shell-api', 'showCfg', '--show-active-only'); +if ($show_default) { + push @show_cmd, '--show-show-defaults'; +} +open(my $show_fd, '-|', @show_cmd) or die 'Cannot execute config output'; +while (<$show_fd>) { + print; +} +close($show_fd); print $version_str; select STDOUT; |