From 5049a27fa480e957f9c3ad19e89c81bd4f073d62 Mon Sep 17 00:00:00 2001 From: 12nick12 Date: Tue, 5 Jun 2018 16:50:25 -0400 Subject: [PATCH] Update sshjump.new --- server/sshjump.new | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/sshjump.new b/server/sshjump.new index 5837484..0673698 100644 --- a/server/sshjump.new +++ b/server/sshjump.new @@ -1,25 +1,27 @@ #!/bin/bash +dir=/opt/sshjump + arg1=$1 if [ $arg1 = list ]; then - sqlite3 /opt/sshjump/sshjump.db 'select host,id from sshjump' + sqlite3 $dir/sshjump.db 'select host,id from sshjump' elif [ $arg1 = host ]; then user=$2 host=$3 - port=$(sqlite3 /opt/sshjump/sshjump.db "select port from sshjump where host = \"$host\"") + port=$(sqlite3 $dir/sshjump.db "select port from sshjump where host = \"$host\"") ssh -p $port $user@localhost elif [ $arg1 = id ]; then user=$2 id=$3 - port=$(sqlite3 /opt/sshjump/sshjump.db "select port from sshjump where id = \"$id\"") + port=$(sqlite3 $dir/sshjump.db "select port from sshjump where id = \"$id\"") ssh -p $port $user@localhost elif [ $arg1 = del ]; then id=$2 - sqlite3 /opt/sshjump/sshjump.db "delete from sshjump where id = \"$id\"" + sqlite3 $dir/sshjump.db "delete from sshjump where id = \"$id\"" elif [ $arg1 = help ]; then echo "list: show list of devices"