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