2025-02-24 20:05:20 +08:00

17 lines
451 B
Bash

#!/bin/bash
# 检查服务是否正在运行
status=$(systemctl is-active advisor-server.service)
if [ "$status" == "active" ]; then
# 如果服务已经在运行,重启服务
echo "AdvisorServer is running. Stopping the service..."
systemctl stop advisor-server.service
if [ $? -eq 0 ]; then
echo "AdvisorServer stopped successfully."
else
echo "Failed to stop AdvisorServer."
fi
else
echo "AdvisorServer is not running."
fi