Add restart script for immich
This commit is contained in:
27
services/immich/restart.sh
Normal file
27
services/immich/restart.sh
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user