23 lines
525 B
Bash
Executable file
23 lines
525 B
Bash
Executable file
#!/bin/bash
|
|
cd "$(dirname "$0")/.."
|
|
. .env
|
|
|
|
./scripts/update_config.sh
|
|
|
|
if [ -n "$IPV6_SUBNET" ]; then
|
|
echo "Rotating IP..."
|
|
python3 smart-ipv6-rotator/smart-ipv6-rotator.py run --ipv6range=$IPV6_SUBNET
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to rotate IP, trying again..."
|
|
python3 smart-ipv6-rotator/smart-ipv6-rotator.py run --ipv6range=$IPV6_SUBNET
|
|
fi
|
|
fi
|
|
|
|
# TODO think about a way to restart only if running
|
|
|
|
echo "Updating..."
|
|
docker compose pull
|
|
|
|
echo "Restarting..."
|
|
docker compose down
|
|
docker compose up -d
|