Create start_systemd.sh

This commit is contained in:
12nick12 2018-06-05 16:06:42 -04:00 committed by GitHub
parent 1fd44094a6
commit 53e106a597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

7
host/start_systemd.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
remoteport=$(sqlite3 /opt/sshjump/sshjump.db 'select port from sshjump')
localport=22
until ping -c1 google.com &>/dev/null; do :; done
autossh -N -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R $remoteport:localhost:$localport root@test.com -p 22333 -i /opt/sshjump/id_rsa