chch-power/sysconfig/etc_rc.local

43 lines
889 B
Plaintext
Raw Normal View History

2017-02-20 00:03:36 +01:00
#!/bin/bash -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
sudo -u automation /home/automation/chch-power/run.sh
{
sleep 60
2017-02-20 00:03:36 +01:00
while /bin/true;
do
/usr/bin/autossh -N -M 0 -o "ServerAliveInterval 5" -o "ServerAliveCountMax 3" -4 -R '127.0.0.1:2322:127.0.0.1:22' automation@vbox.chch.it
2017-02-20 00:03:36 +01:00
sleep 10
done
} &
disown $!
{
sleep 60
2017-02-20 00:03:36 +01:00
while /bin/true;
do
/usr/bin/autossh -N -M 0 -o "ServerAliveInterval 5" -o "ServerAliveCountMax 3" -4 -R '127.0.0.1:2322:127.0.0.1:22' cloudbot@vcup.chch.it
2017-02-20 00:03:36 +01:00
sleep 10
done
} &
disown $!
exit 0