diff --git a/simpleadmin/www/cgi-bin/get_ttl_status b/simpleadmin/www/cgi-bin/get_ttl_status index 03d366b..dc2d54b 100644 --- a/simpleadmin/www/cgi-bin/get_ttl_status +++ b/simpleadmin/www/cgi-bin/get_ttl_status @@ -1,7 +1,7 @@ #!/bin/bash # Check iptables for ttlvalue -ttlvalue=$(iptables -t mangle -vnL | awk '/TTL/ {print $13; exit}') +ttlvalue=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}' | head -n1) ttlenabled=true; # Set Variables @@ -17,4 +17,4 @@ cat </dev/null || true - ip6tables -t mangle -D POSTROUTING -o rmnet+ -j HL --hl-set ${ttlcheck} &>/dev/null || true + if [ ! -z "${ttlcheck}" ]; then + /opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -D POSTROUTING -o rmnet+ -j TTL --ttl-set ${ttlcheck} &>/dev/null || true + /opt/bin/sudo /usr/sbin/ip6tables -w 5 -t mangle -D POSTROUTING -o rmnet+ -j HL --hl-set ${ttlcheck} &>/dev/null || true fi # Echo TTL to file echo $setTTL > /usrdata/simplefirewall/ttlvalue # Set Start Service - /usrdata/simplefirewall/ttl-override start + /opt/bin/sudo /usrdata/simplefirewall/ttl-override start fi # Check iptables for ttlvalue -ttlvalue=$(iptables -t mangle -vnL | grep TTL | awk '{print $13}') +ttlvalue=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}') ttlenabled=true; # Set Variables @@ -58,4 +58,5 @@ cat <