Create sshjump.new

This commit is contained in:
12nick12 2018-06-05 15:24:58 -04:00 committed by GitHub
parent 051233b038
commit 6c2be14a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

21
server/sshjump.new Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
arg1=$1
if [ $arg1 = list ]; then
sqlite3 /opt/sshjump/sshjump.db 'select host,id from sshjump'
fi
if [ $arg1 = host ]; then
user=$2
host=$3
port=$(sqlite3 /opt/sshjump/sshjump.db 'select port from sshjump where host = host')
ssh -p $port $user@localhost
fi
if [ $arg1 = id ]; then
user=$2
id=$3
port=$(sqlite3 /opt/sshjump/sshjump.db 'select port from sshjump where id = id')
ssh -p $port $user@localhost
fi