checks the status of the services

This commit is contained in:
Whispering Wind
2024-10-11 12:36:08 +03:30
committed by GitHub
parent 4fc32ef161
commit feae2afdbb

View File

@ -60,4 +60,22 @@ load_hysteria2_env() {
echo "Error: configs.env file not found. Using default SNI 'bts.com'."
SNI="bts.com"
fi
}
}
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
}