From cf358752b35f71d23c600d524819b290232a037f Mon Sep 17 00:00:00 2001 From: Hai HUANG <101720804+maple367@users.noreply.github.com> Date: Thu, 29 Feb 2024 21:18:39 +0800 Subject: [PATCH] modified: x-ui.sh --- x-ui.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-ui.sh b/x-ui.sh index 0bdc828f..871242e2 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -443,11 +443,12 @@ update_shell() { # 0: running, 1: not running, 2: not installed check_status() { - if [[ ! -f /etc/systemd/system/x-ui.service ]]; then + temp=$(rc-service -l | grep x-ui) + if [[ "${temp}" != "x-ui" ]]; then return 2 fi - temp=$(systemctl status x-ui | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1) - if [[ "${temp}" == "running" ]]; then + temp=$(rc-status | grep x-ui | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1) + if [[ "${temp}" == "started" ]]; then return 0 else return 1