summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2010-06-29 12:05:56 -0700
committerBob Gilligan <gilligan@vyatta.com>2010-06-29 12:05:56 -0700
commit80c6e378459254c776ee87af2a1b042a28cf3d90 (patch)
tree0a490a6c3b79d0a5a4a9b0ffc5cd955d864cbf40 /scripts
parent1ec849bc5a5f4cbe9d273f647b37a2dbc823ed11 (diff)
parent5cc772e57ef3a21f7c5ae6e48b0f8758c82b275d (diff)
downloadvyatta-cfg-80c6e378459254c776ee87af2a1b042a28cf3d90.tar.gz
vyatta-cfg-80c6e378459254c776ee87af2a1b042a28cf3d90.zip
Merge branch 'larkspur' of gilligan@suva:/git/vyatta-cfg into larkspur
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-save-config.pl21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl
index 9a95906..cebdf96 100755
--- a/scripts/vyatta-save-config.pl
+++ b/scripts/vyatta-save-config.pl
@@ -29,16 +29,27 @@ my $bootpath = $etcdir . "/config";
my $save_file = $bootpath . "/config.boot";
my $url_tmp_file = $bootpath . "/config.boot.$$";
-
-if ($#ARGV > 0) {
- print "Usage: save [config_file_name]\n";
+my $set_show_opt = 1;
+if ($#ARGV > 1) {
+ print "Usage: save [config_file_name] --no-defaults\n";
exit 1;
}
+
if (defined($ARGV[0])) {
- $save_file = $ARGV[0];
+ if ($ARGV[0] ne '--no-defaults') {
+ $save_file = $ARGV[0];
+ }
+ else {
+ $set_show_opt = 0;
+ }
+
+ if (defined($ARGV[1]) && $ARGV[1] eq '--no-defaults') {
+ $set_show_opt = 0;
+ }
}
+
my $mode = 'local';
my $proto;
@@ -89,7 +100,7 @@ if ($mode eq 'local') {
}
select $save;
-set_show_all(1);
+set_show_all($set_show_opt);
outputActiveConfig();
print $version_str;
select STDOUT;