Add alpine_chroot/stunnel.sh

This commit is contained in:
2025-09-03 07:05:15 +00:00
parent da68d1ddb0
commit 67b32ce166

35
alpine_chroot/stunnel.sh Normal file
View File

@@ -0,0 +1,35 @@
sh /root/uptime_monitor.sh &
while [ 1 ]
do
if nc -zv -w 2 88.202.151.14 5222 &> /dev/null
then
echo "$(date): success"
echo "$(date): now check whether PID is present (as might be old connection)"
else
echo "$(date): error - xmpp is down, start tunnel 5222"
/usr/bin/ssh -R '*:5222:127.0.0.1:5222' -p 22 -N user@88.202.151.14 &
sleep 2
fi
if nc -zv -w 2 88.202.151.14 5269 &> /dev/null
then
echo "$(date): success"
echo "$(date): now check whether PID is present (as might be old connection)"
else
echo "$(date): error - xmpp is down, start tunnel 5269"
/usr/bin/ssh -R '*:5269:127.0.0.1:5269' -p 22 -N user@88.202.151.14 &
sleep 2
fi
sleep 60
done
echo "$(date): Done"