-
-
Notifications
You must be signed in to change notification settings - Fork 759
/
status.sh
executable file
·65 lines (51 loc) · 2.09 KB
/
status.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
cd $( dirname -- "$0"; )
source ./common/utils.sh
function main(){
# XRAY_NEW_CONFIG_ERROR=0
# xray run -test -confdir xray/configs > /dev/null 2>&1
# XRAY_NEW_CONFIG_ERROR=$?
# SINGBOX_NEW_CONFIG_ERROR=0
# xray run -test -confdir xray/configs > /dev/null 2>&1
# SINGBOX_NEW_CONFIG_ERROR=$?
# systemctl status --no-pager hiddify-nginx hiddify-xray hiddify-singbox hiddify-haproxy|cat
if [[ $(hconfig "warp_mode") != "disable" ]];then
echo -e "\n----------------------------------------------------------------"
bash other/warp/status.sh
fi
echo "----------------------------------------------------------------"
warning "- Global IP:"
proxy_port=1234 # xray local socks5 port
if [[ $(hconfig "core_type") == "singbox" ]];then
proxy_port=2000 # singbox local socks5 port
fi
curl -s -x socks://127.0.0.1:$proxy_port --connect-timeout 1 http://ip-api.com?fields=country,city,org,query | sed 's|^| |; /[{}]/d'
echo "----------------------------------------------------------------"
warning "- Services Status:"
for s in other/**/*.service **/*.service wg-quick@warp mtproto-proxy.service mtproxy.service;do
(
s=${s##*/}
s=${s%%.*}
if [[ $s == "wg-quick@warp" ]] && [[ $(hconfig "warp_mode") == "disable" ]]; then
return
fi
if systemctl is-enabled $s >/dev/null 2>&1 ; then
status=$(get_pretty_service_status $s 2>&1)
printf " %-50s %+19s \n" "$s" "$status"
fi
)&
done
wait
echo "----------------------------------------------------------------"
# echo "ignoring xray test"
# if [ "$XRAY_NEW_CONFIG_ERROR" != "0" ];then
# xray run -test -confdir xray/configs
# echo "There is a big error in xray configuration."
# fi
# if [ "$SINGBOX_NEW_CONFIG_ERROR" != "0" ];then
# sing-box check -C singbox/configs
# echo "There is a big error in xray configuration."
# fi
}
mkdir -p log/system/
main |& tee log/system/status.log