- $image = "$imgstatic/ovpnn2n.png";
- $text = "$Lang::tr{'wio_n2n'}";
- }
- else {
- $image = "$imgstatic/ovpnrw.png";
- $text = "$Lang::tr{'wio_rw'}";
- }
-
- if ( $ovpnconfighash{$key}[0] eq 'off' ) {
- $status = "${Header::colourblue}";
- $statustxt = "$Lang::tr{'capsclosed'}";
- }
- else {
- if ($ovpnconfighash{$key}[3] eq 'net') {
- if (-e "/var/run/$ovpnconfighash{$key}[1]n2n.pid") {
- my @output = "";
- my @tustate = "";
- my $tport = $ovpnconfighash{$key}[22];
- my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport);
- if ($tport ne '') {
- $tnet->open('127.0.0.1');
- @output = $tnet->cmd(String => 'state', Prompt => '/(END.*\n|ERROR:.*\n)/');
- @tustate = split(/\,/, $output[1]);
- $ovpntime = &WIO::contime(scalar localtime($tustate[0]), "ovpn");
-
- if (($tustate[1] eq 'CONNECTED')) {
- $status = "${Header::colourgreen}";
- $statustxt = "$Lang::tr{'capsopen'}";
- }else {
- $status = "${Header::colourred}";
- $statustxt = "$tustate[1]";
- }
+ if (-e "/var/run/$ovpnconfighash{$key}[1]n2n.pid") {
+ my ( @output, @tustate ) = '';
+ my $tport = $ovpnconfighash{$key}[22];
+ my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport);
+ if ($tport ne '') {
+ $tnet->open('127.0.0.1');
+ @output = $tnet->cmd(String => 'state', Prompt => '/(END.*\n|ERROR:.*\n)/');
+ @tustate = split(/\,/, $output[1]);
+ $ovpntime = &WIO::contime(scalar localtime($tustate[0]), "ovpn");
+ $ovpncheck = strftime("%d.%m.%Y - %H:%M:%S", localtime);
+
+ if (($tustate[1] eq 'CONNECTED')) {
+ $status = "${Header::colourgreen}";
+ $statustxt = "$Lang::tr{'capsopen'}";
+ $ovpnrwip = $ovpnconfighash{$key}[11];
+ }
+ else {
+ $status = "${Header::colourred}";
+ $statustxt = "$tustate[1]";