X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2Ftunnel.pl;h=775eaf29069ec1606ebfb5fc7d3e2a13b55d54e1;hb=ca153194fe711932fe62a4753889bc09e35f13ec;hp=56be859f482686d44e1910a2616d7fe90990bd1c;hpb=9abf15e9b838ad1164030fe953b407c97eb8cbce;p=clearscm.git diff --git a/bin/tunnel.pl b/bin/tunnel.pl index 56be859..775eaf2 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); @@ -204,7 +188,7 @@ $opts{daemon} = 0 if defined $DB::OUT; use warnings; $log = Logger->new( - path => '/var/log', + path => '/var/local/log', name => "$Logger::me", timestamped => 'yes', append => 'yes',