From fa451392a5fe46942f1987d54c37a4d26d2f113f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=81nis=20Mez=C4=ABtis?= Date: Tue, 15 Mar 2016 20:51:58 +0200 Subject: [PATCH] Show unicode simbols for sent and received --- jvpn.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/jvpn.pl b/jvpn.pl index 1631512..3953c9b 100755 --- a/jvpn.pl +++ b/jvpn.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -CS # Script to run ncsvc without JAVA gui and web browser @@ -515,11 +515,12 @@ while () { if ($_ =~ m/^\s*${vpnint}:\s*(\d+)(?:\s+\d+){7}\s*(\d+)/) { print "\r \r"; - printf("Duration: %02d:%02d:%02d Sent: %s\tReceived: %s", - int($now / 3600), int(($now % 3600) / 60), int($now % 60), - format_bytes($2), format_bytes($1)); + printf("\x{21d1}:%s \x{21d3}:%s %02d:%02d:%02d", + format_bytes($2), format_bytes($1), + int($now / 3600), int(($now % 3600) / 60), int($now % 60)); } } + printf("Runned for: %02d:%02d:%02d",int($now / 3600), int(($now % 3600) / 60), int($now % 60)) close(STAT); if(!$exists) { INT_handler(); @@ -568,12 +569,13 @@ my $now = time - $start_t; # printing RX/TX. This packet also contains encription type, # compression and transport info, but length seems to be variable - printf("Duration: %02d:%02d:%02d Sent: %s\tReceived: %s", - int($now / 3600), int(($now % 3600) / 60), int($now % 60), - format_bytes(unpack('x[78]N',$data)), format_bytes(unpack('x[68]N',$data))); + printf("\x{21d1}:%s \x{21d3}:%s %02d:%02d:%02d", + format_bytes(unpack('x[78]N',$data)), format_bytes(unpack('x[68]N',$data)), + int($now / 3600), int(($now % 3600) / 60), int($now % 60)); sleep(1); } + printf("Runned for: %02d:%02d:%02d",int($now / 3600), int(($now % 3600) / 60), int($now % 60)) print "Exiting... Connect failed?\n"; $socket->close();