Skip to content

Commit 59a6f93

Browse files
author
Jānis Mezītis
committed
Show unicode simbols for sent and received
1 parent 4c12cee commit 59a6f93

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

jvpn.pl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/perl -CS
22

33
# Script to run ncsvc without JAVA gui and web browser
44

@@ -515,11 +515,12 @@
515515
while (<STAT>) {
516516
if ($_ =~ m/^\s*${vpnint}:\s*(\d+)(?:\s+\d+){7}\s*(\d+)/) {
517517
print "\r \r";
518-
printf("Duration: %02d:%02d:%02d Sent: %s\tReceived: %s",
519-
int($now / 3600), int(($now % 3600) / 60), int($now % 60),
520-
format_bytes($2), format_bytes($1));
518+
printf("\x{21d1}:%s \x{21d3}:%s %02d:%02d:%02d",
519+
format_bytes($2), format_bytes($1),
520+
int($now / 3600), int(($now % 3600) / 60), int($now % 60));
521521
}
522522
}
523+
printf("Runned for: %02d:%02d:%02d",int($now / 3600), int(($now % 3600) / 60), int($now % 60));
523524
close(STAT);
524525
if(!$exists) {
525526
INT_handler();
@@ -568,12 +569,14 @@
568569
my $now = time - $start_t;
569570
# printing RX/TX. This packet also contains encription type,
570571
# compression and transport info, but length seems to be variable
571-
printf("Duration: %02d:%02d:%02d Sent: %s\tReceived: %s",
572-
int($now / 3600), int(($now % 3600) / 60), int($now % 60),
573-
format_bytes(unpack('x[78]N',$data)), format_bytes(unpack('x[68]N',$data)));
572+
printf("\x{21d1}:%s \x{21d3}:%s %02d:%02d:%02d",
573+
format_bytes(unpack('x[78]N',$data)), format_bytes(unpack('x[68]N',$data)),
574+
int($now / 3600), int(($now % 3600) / 60), int($now % 60));
574575
sleep(1);
575576
}
576-
577+
578+
my $now = time - $start_t;
579+
printf("Runned for: %02d:%02d:%02d",int($now / 3600), int(($now % 3600) / 60), int($now % 60));
577580
print "Exiting... Connect failed?\n";
578581

579582
$socket->close();

0 commit comments

Comments
 (0)