chch-power/sysconfig/etc_rc.local

41 lines
845 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
{
while /bin/true;
do
AUTOSSH_FIRST_POLL=30 AUTOSSH_POLL=15 /usr/bin/autossh -N -M 20023 -4 -R '127.0.0.1:2322:127.0.0.1:22' automation@vbox.chch.it
sleep 10
done
} &
disown $!
{
while /bin/true;
do
AUTOSSH_FIRST_POLL=30 AUTOSSH_POLL=15 /usr/bin/autossh -N -M 20025 -4 -R '127.0.0.1:2322:127.0.0.1:22' cloudbot@vcup.chch.it
sleep 10
done
} &
disown $!
exit 0