Create status.sh

This commit is contained in:
Whispering Wind
2024-10-11 13:11:22 +03:30
committed by GitHub
parent f8130b2e64
commit 489666bdd2

View File

@ -0,0 +1,34 @@
source /etc/hysteria/core/scripts/utils.sh
source /etc/hysteria/core/scripts/path.sh
check_warp_configuration() {
echo "${yellow}Current WARP Configuration:${NC}"
echo "--------------------------------"
if jq -e '.acl.inline[]? | select(test("warps\\(all\\)"))' "$CONFIG_FILE" > /dev/null; then
echo -e "${cyan}All traffic:${NC} ${green}Active${NC}"
else
echo -e "${cyan}All traffic:${NC} ${red}Inactive${NC}"
fi
if jq -e '.acl.inline[]? | select(test("warps\\(geosite:google\\)")) or select(test("warps\\(geoip:google\\)")) or select(test("warps\\(geosite:netflix\\)")) or select(test("warps\\(geosite:spotify\\)")) or select(test("warps\\(geosite:openai\\)")) or select(test("warps\\(geoip:openai\\)"))' "$CONFIG_FILE" > /dev/null; then
echo -e "${cyan}Popular sites (Google, Netflix, etc.):${NC} ${green}Active${NC}"
else
echo -e "${cyan}Popular sites (Google, Netflix, etc.):${NC} ${red}Inactive${NC}"
fi
if jq -e '.acl.inline[]? | select(test("warps\\(geosite:ir\\)")) or select(test("warps\\(geoip:ir\\)"))' "$CONFIG_FILE" > /dev/null; then
echo -e "${cyan}Domestic sites (geosite:ir, geoip:ir):${NC} ${green}Active${NC}"
else
echo -e "${cyan}Domestic sites (geosite:ir, geoip:ir):${NC} ${red}Inactive${NC}"
fi
if jq -e '.acl.inline[]? | select(test("reject\\(geosite:category-porn\\)"))' "$CONFIG_FILE" > /dev/null; then
echo -e "${cyan}Block adult content:${NC} ${green}Active${NC}"
else
echo -e "${cyan}Block adult content:${NC} ${red}Inactive${NC}"
fi
echo "--------------------------------"
}
define_colors
check_warp_configuration