From 95cdf02105731745f7e890bad8f1bacc4ad7a894 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 22 Oct 2025 15:18:25 +0200 Subject: [PATCH] Add restart script for immich --- services/immich/restart.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 services/immich/restart.sh diff --git a/services/immich/restart.sh b/services/immich/restart.sh new file mode 100644 index 0000000..3cbd270 --- /dev/null +++ b/services/immich/restart.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Only allow 'start' or 'stop' as the first argument +if [[ "$1" != "start" && "$1" != "stop" && "$1" != "restart" ]]; then + echo "Usage: $0 {start|stop|restart}" + exit 1 +fi + +# List of OpenRC services (without .service suffix) +services=( + immich_machine_learning + immich_postgres + immich_redis + immich_server +) + +for service in "${services[@]}"; do + echo "$1 $service..." + rc-service "$service.service" $1 + + # Optional: check if command was successful + if [ $? -eq 0 ]; then + echo "$service ${1}ed successfully." + else + echo "Failed to $1 $service." + fi +done