2022-11-27 13:14:08 +00:00
|
|
|
#!/bin/bash
|
2022-11-27 16:08:20 +00:00
|
|
|
if [ "$1" = "docker" ]; then
|
|
|
|
cd "/usr/bin/app" || exit
|
|
|
|
while :
|
|
|
|
do
|
|
|
|
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"
|
|
|
|
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
|
2022-11-27 17:39:34 +00:00
|
|
|
ipv4=$(curl -k -s https://am.i.mullvad.net/ip -4)
|
2022-11-27 16:08:20 +00:00
|
|
|
ipv6=$(curl -k -s https://ipv6.am.i.mullvad.net/)
|
2022-11-27 17:35:36 +00:00
|
|
|
source venv/bin/activate
|
2022-11-27 16:08:20 +00:00
|
|
|
python3 ./cloudflare_script.py 4 "$ipv4"
|
|
|
|
python3 ./cloudflare_script.py 6 "$ipv6"
|
|
|
|
fi
|
|
|
|
fi
|