From e5665c872a14dea1685ca3d06776eafa6162fe8d Mon Sep 17 00:00:00 2001 From: Lucian Balaceanu Date: Fri, 9 Oct 2015 18:40:18 +0300 Subject: [PATCH] Add --help/-h. Fix truncated ctl output for large commands --- utils/rtpengine-ctl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/rtpengine-ctl b/utils/rtpengine-ctl index 464fcf0d4..d39c48f25 100755 --- a/utils/rtpengine-ctl +++ b/utils/rtpengine-ctl @@ -3,7 +3,9 @@ use IO::Socket::INET; $num_args = $#ARGV + 1; -if ($num_args == 0) { +if ( ($num_args == 0) or + (($num_args == 1) && (($ARGV[0] eq "--help") or ($ARGV[0] eq "-h"))) ) +{ showusage(); exit; } @@ -45,9 +47,12 @@ shutdown($socket, 1); # receive a response of up to 10MB my $response = ""; -$socket->recv($response, 1024*1024*10); -print $response; +do { + $response = ""; + $socket->recv($response, 1024*1024*10); + print $response; +} while ( not $response eq ""); $socket->close();