Create 10-test_vpn.sh

This commit is contained in:
Alexandre
2023-12-11 17:59:41 +01:00
committed by GitHub
parent ddeadf407a
commit bf37c75b92

View File

@@ -0,0 +1,11 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# if doesn't work, try UDP
if [ ! -f /data/tdp ]; then
ping -c 1 1.1.1.1 &> /dev/null || ( bashio::log.warning "Can't connect, trying with TDP" && \
touch /data/tdp && bashio::addon.restart )
else
ping -c 1 1.1.1.1 &> /dev/null || ( bashio::log.warning "Can't connect even with TDP, reverting to default" && \
rm /data/tdp && bashio::addon.restart )
fi