From feae2afdbb0b62b0fa4ca8d521820a95854699c5 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:36:08 +0330 Subject: [PATCH] checks the status of the services --- core/scripts/utils.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/scripts/utils.sh b/core/scripts/utils.sh index 8cfa96b..287929d 100644 --- a/core/scripts/utils.sh +++ b/core/scripts/utils.sh @@ -60,4 +60,22 @@ load_hysteria2_env() { echo "Error: configs.env file not found. Using default SNI 'bts.com'." SNI="bts.com" fi -} \ No newline at end of file +} + +check_services() { + declare -A service_names=( + ["hysteria-server.service"]="Hysteria" + ["normalsub.service"]="Normal Subscription" + ["singbox.service"]="Singbox Subscription" + ["hysteria-bot.service"]="Hysteria Telegram Bot" + ["wg-quick@wgcf.service"]="WireGuard (WARP)" + ) + + for service in "${!service_names[@]}"; do + if systemctl is-active --quiet "$service"; then + echo -e "${NC}${service_names[$service]}:${green} Active${NC}" + else + echo -e "${NC}${service_names[$service]}:${red} Not Active${NC}" + fi + done +}