diff options
author | Mohit Mehta <mohit@vyatta.com> | 2011-05-04 17:41:21 -0700 |
---|---|---|
committer | Mohit Mehta <mohit@vyatta.com> | 2011-05-04 17:41:21 -0700 |
commit | 828ddec316c54b5550a0c5cdc0c964e454e67f86 (patch) | |
tree | c57985cd99a3f57bbaa0ceb926cd51ff13f14944 /lib/Vyatta | |
parent | 20935c34d6fad4af9ab27e4a1b934e7e9e375358 (diff) | |
download | vyatta-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 'lib/Vyatta')
-rwxr-xr-x | lib/Vyatta/Misc.pm | 12 |
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 ) = @_; |