sshjump/host/start_systemd.sh

11 lines
352 B
Bash
Raw Normal View History

2018-06-05 16:06:42 -04:00
#!/bin/bash
2018-06-05 16:49:34 -04:00
dir=/opt/sshjump
2018-06-05 16:48:51 -04:00
serverhost=user@test.test.com
serviceport=22333
remoteport=$(sqlite3 $dir/sshjump.db 'select port from sshjump')
2018-06-05 16:06:42 -04:00
localport=22
until ping -c1 google.com &>/dev/null; do :; done
2018-06-05 16:48:51 -04:00
autossh -N -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R $remoteport:localhost:$localport $server -p $serverport -i $dir/id_rsa