Does not break usage outside of a Docker container, specify "docker" for use in a docker container
This commit is contained in:
Neshura 2022-11-27 17:08:20 +01:00
parent 51a20e52af
commit bf3f0ed24f
No known key found for this signature in database
GPG key ID: ACDF5B6EBECF6B0A

View file

@ -1,4 +1,5 @@
#!/bin/bash
if [ "$1" = "docker" ]; then
cd "/usr/bin/app" || exit
while :
do
@ -8,3 +9,13 @@ python3 ./cloudflare_script.py 4 "$ipv4"
python3 ./cloudflare_script.py 6 "$ipv6"
sleep 120
done
else
if [ ! -e cloudflare.json ] || [ ! -e config.ini ]; then
echo "Cloudflare config not found, is the script run in the correct directory?"
else
ipv4=$(curl -k -s https://am.i.mullvad.net/ip)
ipv6=$(curl -k -s https://ipv6.am.i.mullvad.net/)
python3 ./cloudflare_script.py 4 "$ipv4"
python3 ./cloudflare_script.py 6 "$ipv6"
fi
fi