summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMohit Mehta <mohit@vyatta.com>2011-05-04 17:41:21 -0700
committerMohit Mehta <mohit@vyatta.com>2011-05-04 17:41:21 -0700
commit828ddec316c54b5550a0c5cdc0c964e454e67f86 (patch)
treec57985cd99a3f57bbaa0ceb926cd51ff13f14944 /scripts
parent20935c34d6fad4af9ab27e4a1b934e7e9e375358 (diff)
downloadvyatta-cfg-828ddec316c54b5550a0c5cdc0c964e454e67f86.tar.gz
vyatta-cfg-828ddec316c54b5550a0c5cdc0c964e454e67f86.zip
Fix Bug 7010 Update commands to save/retrieve files from /config
* use shorter /config path when presenting configuration directory to users
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-load-config.pl7
-rwxr-xr-xscripts/vyatta-save-config.pl5
2 files changed, 10 insertions, 2 deletions
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index 116e506..7bf7779 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -29,6 +29,7 @@ use Getopt::Long;
use Sys::Syslog qw(:standard :macros);
use Vyatta::Config;
use Vyatta::ConfigLoad;
+use Vyatta::Misc qw(get_short_config_path);
$SIG{'INT'} = 'IGNORE';
@@ -174,7 +175,11 @@ system("$sbindir/vyatta_config_migrate.pl $load_file");
# note: "load" is now handled in the backend so only "merge" is actually
# handled in this script. "merge" hasn't been moved into the backend since
# the command itself needs to be revisited after mendocino time frame.
-print "Loading configuration from '$load_file'...\n";
+
+# when presenting to users, show shortened /config path
+my $shortened_load_file = get_short_config_path($load_file);
+print "Loading configuration from '$shortened_load_file'...\n";
+
my $cobj = new Vyatta::Config;
if (!defined($merge)) {
# "load" => use backend through API
diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl
index 4af5d97..178eff7 100755
--- a/scripts/vyatta-save-config.pl
+++ b/scripts/vyatta-save-config.pl
@@ -23,6 +23,7 @@ use strict;
use lib "/opt/vyatta/share/perl5";
use Vyatta::ConfigOutput;
use File::Sync qw(fsync);
+use Vyatta::Misc qw(get_short_config_path);
my $etcdir = "/opt/vyatta/etc";
my $bootpath = $etcdir . "/config";
@@ -76,7 +77,9 @@ if ($mode eq 'local' and !($save_file =~ /^\//)) {
}
my $version_str = `/opt/vyatta/sbin/vyatta_current_conf_ver.pl`;
-print "Saving configuration to '$save_file'...\n";
+# when presenting to users, show shortened /config path
+my $shortened_save_file = get_short_config_path($save_file);
+print "Saving configuration to '$shortened_save_file'...\n";
my $save;
if ($mode eq 'local') {