diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-01-31 21:07:37 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-01-31 21:07:37 +0100 |
commit | 724eb33c2a3fb121731f254c20af10107ef74086 (patch) | |
tree | 4decbe20118cf6921167ba6fac93f1069cec1e30 /bin | |
parent | b11c3ec341b6282c21c23e2226cce41434651d61 (diff) |
Remove hardcoded share path
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/vnet | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -15,7 +15,7 @@ use LWP::Simple; my %opts; my $alpha; -my $share = "$ENV{HOME}/packages/visual/share"; +my $share = $0; my ($ext_ip, $int_ip); sub get_ext_ip { @@ -68,6 +68,17 @@ sub show_net_console { ); } +if (-l $share) { + my $link = readlink($share); + $share =~ s{ [^/]+ $ }{}x; + $link =~ s{ / bin / vnet $ }{}x; + $share .= "${link}/share"; +} +else { + $share =~ s{ / bin / vnet $ }{}x; + $share .= '/share'; +} + getopts('a:cfg', \%opts); $alpha = $opts{'a'} // 0; |