all the python scripts are for python2, and fedora31 requires to be specific
[vsys-scripts.git] / root-context / exec / goodfences
1 #!/usr/bin/perl
2
3 use strict;
4
5 $|=1;
6
7 my $slicename;
8 my $portnumber;
9
10
11 $slicename = $ARGV[0];
12 $portnumber = <STDIN>;
13
14 chop($portnumber);
15
16 if ($portnumber!~/^\d+$/) {
17         die("$portnumber is not a port number");
18 }
19
20 open CMD,"/sbin/fuser -n tcp $portnumber 2>&1|";
21
22 $_ = <CMD>;
23
24 my @ports;
25 @ports=split;
26
27 if ($#ports > 0) {
28         system("cat /proc/$ports[1]/vinfo");
29         print "Please refer to http://planetflow.planet-lab.org/lookupslice.php to obtain the name corresponding to this slice.";
30 }
31
32 close CMD;