From e08fdbe279632c634152501ba4b478065cf9739c Mon Sep 17 00:00:00 2001 From: Russel Yasol Date: Fri, 10 May 2024 10:16:30 +0800 Subject: [PATCH] removed unnecessary console links and ttl files --- simpleadmin/script/sms.sh | 31 +++++++++++ simpleadmin/www/cgi-bin/get_ttl_status.old | 20 ------- simpleadmin/www/cgi-bin/set_ttl.old | 61 ---------------------- 3 files changed, 31 insertions(+), 81 deletions(-) create mode 100644 simpleadmin/script/sms.sh delete mode 100644 simpleadmin/www/cgi-bin/get_ttl_status.old delete mode 100644 simpleadmin/www/cgi-bin/set_ttl.old diff --git a/simpleadmin/script/sms.sh b/simpleadmin/script/sms.sh new file mode 100644 index 0000000..31497cb --- /dev/null +++ b/simpleadmin/script/sms.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Check if the required parameters are provided +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Assign the provided parameters to variables +phone_number="$1" +message="$2" + +# Send the AT command to set the message format to text mode +echo -ne "AT+CMGF=1\r" > microcom /dev/ttyOUT2 +sleep 1 +echo -ne "AT+CNMI=2,1\r" > microcom /dev/ttyOUT2 +sleep 1 +echo -ne 'AT+CMGS="09938931024"\r' > microcom /dev/ttyOUT2 +sleep 1 + +# Send the message +echo -ne "$message" > microcom /dev/ttyOUT2 +echo -ne "\032" > microcom /dev/ttyOUT2 + +# Wait for the response +sleep 1 + +# Capture and output the response +runcmd=$(microcom /dev/ttyOUT2) +# echo "Content-type: text/plain" +echo "$runcmd" \ No newline at end of file diff --git a/simpleadmin/www/cgi-bin/get_ttl_status.old b/simpleadmin/www/cgi-bin/get_ttl_status.old deleted file mode 100644 index 03d366b..0000000 --- a/simpleadmin/www/cgi-bin/get_ttl_status.old +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Check iptables for ttlvalue -ttlvalue=$(iptables -t mangle -vnL | awk '/TTL/ {print $13; exit}') -ttlenabled=true; - -# Set Variables -if [ -z "${ttlvalue}" ]; then - ttlvalue=0 - ttlenabled=false -fi - -echo "Content-type: text/json" -echo "" -cat </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 - /usrdata/simplefirewall/ttl-override start -fi - - - -# Check iptables for ttlvalue -ttlvalue=$(iptables -t mangle -vnL | grep TTL | awk '{print $13}') -ttlenabled=true; - -# Set Variables -if [ -z "${ttlvalue}" ]; then - ttlvalue=0 - ttlenabled=false -fi - -echo "Content-type: text/json" -echo "" -cat <