voicepeak_api/manage_service.sh
2024-08-03 20:12:30 +09:00

20 lines
493 B
Bash

#!/bin/bash
SERVICE_NAME="voicepeak-api.service"
# サービスの状態を確認
SERVICE_STATUS=$(systemctl is-active $SERVICE_NAME)
if [ "$SERVICE_STATUS" = "active" ]; then
echo "Restarting $SERVICE_NAME..."
sudo systemctl daemon-reload
sudo systemctl restart $SERVICE_NAME
else
echo "Reloading and starting $SERVICE_NAME..."
sudo systemctl daemon-reload
sudo systemctl start $SERVICE_NAME
fi
# サービスの状態を表示
sudo systemctl status $SERVICE_NAME