summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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 ) = @_;