|
1 | | -#!/usr/bin/perl |
| 1 | +#!/usr/bin/perl -CS |
2 | 2 |
|
3 | 3 | # Script to run ncsvc without JAVA gui and web browser |
4 | 4 |
|
|
515 | 515 | while (<STAT>) { |
516 | 516 | if ($_ =~ m/^\s*${vpnint}:\s*(\d+)(?:\s+\d+){7}\s*(\d+)/) { |
517 | 517 | 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)); |
521 | 521 | } |
522 | 522 | } |
| 523 | + printf("Runned for: %02d:%02d:%02d",int($now / 3600), int(($now % 3600) / 60), int($now % 60)); |
523 | 524 | close(STAT); |
524 | 525 | if(!$exists) { |
525 | 526 | INT_handler(); |
|
568 | 569 | my $now = time - $start_t; |
569 | 570 | # printing RX/TX. This packet also contains encription type, |
570 | 571 | # 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)); |
574 | 575 | sleep(1); |
575 | 576 | } |
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)); |
577 | 580 | print "Exiting... Connect failed?\n"; |
578 | 581 |
|
579 | 582 | $socket->close(); |
|
0 commit comments