From 61aeb6380d76381a7d79a03e3b0dae14696862ce Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Sat, 17 Aug 2024 15:43:46 +0200 Subject: [PATCH] restart on error --- taiko-hekla.maintenance | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 taiko-hekla.maintenance diff --git a/taiko-hekla.maintenance b/taiko-hekla.maintenance new file mode 100644 index 00000000..3a7d7f15 --- /dev/null +++ b/taiko-hekla.maintenance @@ -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