From: Nicolas Boisselier Date: Thu, 3 Mar 2016 11:07:01 +0000 (+0000) Subject: better ssh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=666833152fc852dd80f97c6f71f4e41957810ce6;p=nb.git better ssh --- diff --git a/bin/dbq b/bin/dbq index 906364fa..944fb99c 100755 --- a/bin/dbq +++ b/bin/dbq @@ -77,7 +77,6 @@ get_options(\%Opt,\@CURL_OPT); # Get URL # my $url = ($ENV{$UC_NAME.'_URL'} ? $ENV{$UC_NAME.'_URL'} : '/opt/rent/www/index.php'); - if (!$Opt{ssh} and @ARGV and ($ARGV[0] =~ m|^\w+://| or -e $ARGV[0] )) { $url = shift @ARGV; @EXEC = grep {$_ ne $url} @EXEC; @@ -85,8 +84,14 @@ if (!$Opt{ssh} and @ARGV and ($ARGV[0] =~ m|^\w+://| or -e $ARGV[0] )) { #die $Opt{ssh}; #exec('ssh',$ARGV[0] && shift @ARGV,$NAME,@ARGV) if @ARGV and $ARGV[0] eq '--ssh' and shift @ARGV; +# +# Handle format proto://db:table@hosts +# $url =~ s,^(\w+://)?([^@]+)@(.*?)$,$1$3, and push(@EXEC,"db=$2"); +# +# Proto SSH +# $url =~ m@^ssh://(.*)$@ and $Opt{ssh} = $1; #die "$url | ",join(' ',@EXEC);