From 15ad1f511586efb7fafe919a9817b597b0e86f8f Mon Sep 17 00:00:00 2001 From: itdoginfo Date: Wed, 13 Mar 2024 20:41:59 +0300 Subject: [PATCH] Added UCI sing-box validation, curl to --interface check for proxy --- getdomains-check.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/getdomains-check.sh b/getdomains-check.sh index 379b9ad..4ed38e0 100755 --- a/getdomains-check.sh +++ b/getdomains-check.sh @@ -184,12 +184,18 @@ if opkg list-installed | grep -q sing-box; then checkpoint_false "Route table Sing-box. Try service network restart. Details: https://cli.co/n7xAbc1" fi + # Sing-box uci validation + if uci show sing-box 2>&1 | grep -q "Parse error"; then + checkpoint_false "Sing-box UCI config. Check /etc/config/sing-box" + else + checkpoint_true "Sing-box UCI config" + fi + + # Check traffic IP_EXTERNAL=$(curl -s ifconfig.me) IFCONFIG=$(nslookup -type=a ifconfig.me | awk '/^Address: / {print $2}') - ip route add $IFCONFIG via 172.19.0.1 dev tun0 - IP_VPN=$(curl -s ifconfig.me) - ip route del $IFCONFIG via 172.19.0.1 dev tun0 + IP_VPN=$(curl --interface tun0 -s ifconfig.me) if [ "$IP_EXTERNAL" != $IP_VPN ]; then checkpoint_true "Sing-box. VPN IP: $IP_VPN" @@ -214,9 +220,7 @@ if which tun2socks | grep -q tun2socks; then IP_EXTERNAL=$(curl -s ifconfig.me) IFCONFIG=$(nslookup -type=a ifconfig.me | awk '/^Address: / {print $2}') - ip route add $IFCONFIG via 172.16.250.1 dev tun0 - IP_VPN=$(curl -s ifconfig.me) - ip route del $IFCONFIG via 172.16.250.1 dev tun0 + IP_VPN=$(curl --interface tun0 -s ifconfig.me) if [ "$IP_EXTERNAL" != $IP_VPN ]; then checkpoint_true "tun2socks. VPN IP: $IP_VPN"