diff options
-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; |