summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMohit Mehta <mohit@vyatta.com>2011-05-04 17:41:21 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2011-05-05 15:34:54 +0800
commit27aa05b628a0272c4c0832edbbf3936e84f533ab (patch)
tree48e7fe38c5839cf96365ccaf7ecad6925a974251 /lib
parent1b2a0fd1ae1e6dfc18e4f75f73cd7befb47cf538 (diff)
downloadvyatta-cfg-27aa05b628a0272c4c0832edbbf3936e84f533ab.tar.gz
vyatta-cfg-27aa05b628a0272c4c0832edbbf3936e84f533ab.zip
Fix Bug 7010 Update commands to save/retrieve files from /config
* use shorter /config path when presenting configuration directory to users (cherry picked from commit 828ddec316c54b5550a0c5cdc0c964e454e67f86)
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Misc.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm
index e184523..4818e65 100755
--- a/lib/Vyatta/Misc.pm
+++ b/lib/Vyatta/Misc.pm
@@ -30,7 +30,8 @@ our @EXPORT = qw(getInterfaces getIP getNetAddIP get_sysfs_value
is_local_address is_primary_address get_ipnet_intf_hash);
our @EXPORT_OK = qw(generate_dhclient_intf_files
getInterfacesIPadresses
- getPortRuleString);
+ getPortRuleString
+ get_short_config_path);
use Vyatta::Config;
use Vyatta::Interface;
@@ -105,6 +106,15 @@ sub is_primary_address {
return;
}
+# remove '/opt/vyatta/etc' from begining of config directory path
+sub get_short_config_path {
+ my $cfg_path = shift;
+ my $shortened_cfg_path = "";
+ $shortened_cfg_path = $cfg_path if defined $cfg_path;
+ $shortened_cfg_path =~ s/^\/opt\/vyatta\/etc//;
+ return $shortened_cfg_path;
+}
+
sub get_sysfs_value {
my ( $intf, $name ) = @_;