fixed file dir locations

This commit is contained in:
Russel Yasol
2024-05-08 15:25:46 +08:00
parent 41ee583c8d
commit 5369e15a84
28 changed files with 137 additions and 3988 deletions

View File

@@ -16,8 +16,8 @@ fi
MYATCMD=$(printf '%b\n' "${atcmd//%/\\x}")
if [ -n "${MYATCMD}" ]; then
x=$(urldecode "$atcmd")
# Initialize wait time to 1 second
wait_time=1000
# Initialize wait time to 200 ms
wait_time=200
while true; do
runcmd=$(echo -en "$x\r\n" | microcom -t $wait_time /dev/ttyOUT2)
# Check if "OK" or "ERROR" is present in the response

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# Check iptables for ttlvalue
ttlvalue=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}' | head -n1)
ttlvalue=$(iptables -t mangle -vnL | awk '/TTL/ {print $13; exit}')
ttlenabled=true;
# Set Variables
@@ -17,4 +17,4 @@ cat <<EOT
"isEnabled": $ttlenabled,
"ttl": $ttlvalue
}
EOT
EOT

View File

@@ -1,5 +1,5 @@
#!/bin/bash
PATH=/bin:/usr/sbin:/usr/bin:/sbin:/opt/sbin:/opt/bin:/usrdata/root/bin
# Get query
QUERY_STRING=$(echo "${QUERY_STRING}" | sed 's/;//g')
@@ -22,28 +22,28 @@ setTTL=$(printf '%b\n' "${ttlvalue//%/\\x}")
if [ -n "${setTTL}" ]; then
# Stop Service To Remove Rules
/opt/bin/sudo /usrdata/simplefirewall/ttl-override stop
/usrdata/simplefirewall/ttl-override stop
# Check iptables is still set
ttlcheck=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}')
ttlcheck=$(iptables -t mangle -vnL | grep TTL | awk '{print $13}')
# If TTL is still set manually remove values
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
if [ !-z "${ttlcheck}" ]; then
iptables -t mangle -D POSTROUTING -o rmnet+ -j TTL --ttl-set ${ttlcheck} &>/dev/null || true
ip6tables -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
/opt/bin/sudo /usrdata/simplefirewall/ttl-override start
/usrdata/simplefirewall/ttl-override start
fi
# Check iptables for ttlvalue
ttlvalue=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}')
ttlvalue=$(iptables -t mangle -vnL | grep TTL | awk '{print $13}')
ttlenabled=true;
# Set Variables
@@ -58,5 +58,4 @@ cat <<EOT
{
"isEnabled": $ttlenabled,
"ttl": $ttlvalue
}
EOT
}