restart on error

This commit is contained in:
Sebastian
2024-08-17 15:43:46 +02:00
parent 9d2d6304f9
commit 61aeb6380d

13
taiko-hekla.maintenance Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if the error is in the logs
if docker logs rpc-taiko-hekla-client-driver-1 2>&1 | grep -q "Create chain head subscription error"; then
# Navigate to the specified directory
cd $script_dir || exit
# Recreate the service
docker compose up -d --force-recreate taiko-hekla taiko-hekla-client-driver
else
echo "No error found in the logs"
fi