X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2Ftunnel.pl;h=86cf076fbbb5e8d908b008a941e669f4112b8d20;hb=ded8d315fd3f6c050f759865b09f053ae85e52a5;hp=56be859f482686d44e1910a2616d7fe90990bd1c;hpb=6412858fa52f00c96d6239e28c5cba7d5d342474;p=clearscm.git diff --git a/bin/tunnel.pl b/bin/tunnel.pl index 56be859..86cf076 100755 --- a/bin/tunnel.pl +++ b/bin/tunnel.pl @@ -68,6 +68,7 @@ use Pod::Usage; use Display; use Logger; +use Speak; use Utils; my $VERSION = '$Revision: 1.0 $'; @@ -89,27 +90,10 @@ my %opts = ( my ($log, $ssh); -sub Say($) { - my ($msg) = @_; - - if (-f "$FindBin::Bin/shh") { - $log->msg("Not speaking because we were asked to be quiet - $msg"); - - return; - } # if - - my ($status, @output) = Execute "/usr/local/bin/gt \"$msg\""; - - $log->err("Unable to speak (Status: $status) - " - . join ("\n", @output), $status) if $status; - - return; -} # Say - sub Report ($;$) { my ($msg, $err) = @_; - Say $msg; + speak $msg, $log; if ($err) { $log->err($msg, $err); @@ -157,7 +141,7 @@ RETRY: my $msg = 'Ssh tunnel '; $msg .= $retryattempts ? 'reestablished' : 'established'; - Say $msg if $opts{announce}; + speak $msg, $log if $opts{announce}; $log->msg($msg);