From 285737488be72776073b5aaa9c6ef048d384ac7b Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Fri, 24 Oct 2025 15:09:41 +0200 Subject: [PATCH] fix: Use service name instead of container name in restart script - Changed docker compose restart to use 'trading-bot' service name - Fixed 'no such service' error - Tested and verified restart functionality works --- watch-restart.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/watch-restart.sh b/watch-restart.sh index c68a44e..8a8724a 100755 --- a/watch-restart.sh +++ b/watch-restart.sh @@ -6,10 +6,10 @@ WATCH_DIR="/home/icke/traderv4/logs" RESTART_FLAG="$WATCH_DIR/.restart-requested" -CONTAINER_NAME="trading-bot-v4" +SERVICE_NAME="trading-bot" echo "🔍 Watching for restart requests in: $WATCH_DIR" -echo "📦 Container: $CONTAINER_NAME" +echo "📦 Service: $SERVICE_NAME" echo "" # Create logs directory if it doesn't exist @@ -18,19 +18,19 @@ mkdir -p "$WATCH_DIR" while true; do if [ -f "$RESTART_FLAG" ]; then echo "🔄 Restart requested at $(cat $RESTART_FLAG)" - echo "🔄 Restarting container: $CONTAINER_NAME" + echo "🔄 Restarting service: $SERVICE_NAME" # Remove flag before restart rm "$RESTART_FLAG" - # Restart container + # Restart service using docker compose cd /home/icke/traderv4 - docker compose restart $CONTAINER_NAME + docker compose restart $SERVICE_NAME if [ $? -eq 0 ]; then - echo "✅ Container restarted successfully" + echo "✅ Service restarted successfully" else - echo "❌ Failed to restart container" + echo "❌ Failed to restart service" fi echo "" fi