]> git.nbdom.net Git - nb.git/commitdiff
better ssh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 3 Mar 2016 11:07:01 +0000 (11:07 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 3 Mar 2016 11:07:01 +0000 (11:07 +0000)
bin/dbq

diff --git a/bin/dbq b/bin/dbq
index 906364fa780e44f342b73e196be09caa1765562c..944fb99c9bdd98c3cb41f43916887af4b1b2bbdf 100755 (executable)
--- 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);