Skip to content

Commit c184541

Browse files
author
Jānis Mezītis
committed
Added how long vpn session runned when we kill session
1 parent 59a6f93 commit c184541

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jvpn.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514
open STAT, "/proc/net/dev" or die $!;
515515
while (<STAT>) {
516516
if ($_ =~ m/^\s*${vpnint}:\s*(\d+)(?:\s+\d+){7}\s*(\d+)/) {
517-
print "\r \r";
517+
print "\r \r";
518518
printf("\x{21d1}:%s \x{21d3}:%s %02d:%02d:%02d",
519519
format_bytes($2), format_bytes($1),
520520
int($now / 3600), int(($now % 3600) / 60), int($now % 60));
@@ -557,7 +557,7 @@
557557
while ( 1 ) {
558558
#stat query
559559
$data="\0\0\0\0\0\0\0\x69\x01\0\0\0\x01\0\0\0\0\0\0\0";
560-
print "\r \r";
560+
print "\r \r";
561561
hdump($data) if $debug;
562562
print $socket "$data";
563563
$socket->recv($data,2048);
@@ -627,6 +627,8 @@ sub INT_handler {
627627
# xxx - we are ignoring reply
628628
hdump($data) if $debug;
629629
}
630+
my $now = time - $start_t;
631+
printf("Runned for: %02d:%02d:%02d\n",int($now / 3600), int(($now % 3600) / 60), int($now % 60));
630632
print "Logging out...\n";
631633
# do logout
632634
$ua -> get ("https://$dhost:$dport/dana-na/auth/logout.cgi");

0 commit comments

Comments
 (0)