This repository has been archived on 2025-06-03. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
companion-setup/scripts/reset.sh
2025-04-12 15:06:37 +02:00

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