Closes #4
Does not break usage outside of a Docker container, specify "docker" for use in a docker container
This commit is contained in:
parent
51a20e52af
commit
bf3f0ed24f
1 changed files with 20 additions and 9 deletions
29
set_ip.sh
29
set_ip.sh
|
@ -1,10 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd "/usr/bin/app" || exit
|
if [ "$1" = "docker" ]; then
|
||||||
while :
|
cd "/usr/bin/app" || exit
|
||||||
do
|
while :
|
||||||
ipv4=$(curl -k -s https://am.i.mullvad.net/ip)
|
do
|
||||||
ipv6=$(curl -k -s https://ipv6.am.i.mullvad.net/)
|
ipv4=$(curl -k -s https://am.i.mullvad.net/ip)
|
||||||
python3 ./cloudflare_script.py 4 "$ipv4"
|
ipv6=$(curl -k -s https://ipv6.am.i.mullvad.net/)
|
||||||
python3 ./cloudflare_script.py 6 "$ipv6"
|
python3 ./cloudflare_script.py 4 "$ipv4"
|
||||||
sleep 120
|
python3 ./cloudflare_script.py 6 "$ipv6"
|
||||||
done
|
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
|
Loading…
Reference in a new issue