get rid of autossh and work around "bash -e" terminating while loop
This commit is contained in:
parent
3a31b82d2b
commit
e6c79d209f
|
@ -19,28 +19,28 @@ fi
|
||||||
|
|
||||||
sudo -u automation /home/automation/chch-power/run.sh
|
sudo -u automation /home/automation/chch-power/run.sh
|
||||||
|
|
||||||
{
|
(
|
||||||
|
set +e # disable bash errexit
|
||||||
sleep 60
|
sleep 60
|
||||||
while /bin/true;
|
while true; do
|
||||||
do
|
|
||||||
# cat ~/.ssh/authorized_key
|
# cat ~/.ssh/authorized_key
|
||||||
# restrict,command="",port-forwarding ssh-rsa AAAA...
|
# restrict,command="",port-forwarding ssh-rsa AAAA...
|
||||||
autossh ssh-port-forwarding@vbox.chch.it -M 0 -o "TCPKeepAlive yes" -o "ServerAliveInterval 5" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure yes" -N -4 -R '127.0.0.1:2322:127.0.0.1:22'
|
ssh ssh-port-forwarding@vbox.chch.it -TNnqakx -o "TCPKeepAlive yes" -o "ServerAliveInterval 5" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure yes" -N -4 -R '127.0.0.1:2322:127.0.0.1:22' -L '127.0.0.1:2525:127.0.0.1:25'
|
||||||
sleep 30
|
sleep 30
|
||||||
done
|
done
|
||||||
} &
|
) &
|
||||||
disown $!
|
disown
|
||||||
|
|
||||||
{
|
(
|
||||||
|
set +e # disable bash errexit
|
||||||
sleep 60
|
sleep 60
|
||||||
while /bin/true;
|
while true; do
|
||||||
do
|
|
||||||
# cat ~/.ssh/authorized_key
|
# cat ~/.ssh/authorized_key
|
||||||
# restrict,command="",port-forwarding ssh-rsa AAAA...
|
# restrict,command="",port-forwarding ssh-rsa AAAA...
|
||||||
autossh ssh-port-forwarding@vcup.chch.it -M 0 -o "TCPKeepAlive yes" -o "ServerAliveInterval 5" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure yes" -N -4 -R '127.0.0.1:2322:127.0.0.1:22'
|
ssh ssh-port-forwarding@vcup.chch.it -TNnqakx -o "TCPKeepAlive yes" -o "ServerAliveInterval 5" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure yes" -N -4 -R '127.0.0.1:2322:127.0.0.1:22'
|
||||||
sleep 30
|
sleep 30
|
||||||
done
|
done
|
||||||
} &
|
) &
|
||||||
disown $!
|
disown
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue