summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/vnet13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/vnet b/bin/vnet
index 7e78295..aa4f7c0 100755
--- a/bin/vnet
+++ b/bin/vnet
@@ -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;