Files
quectel-rgmii-toolkit/simpleadmin/www/cgi-bin/get_atcommand
iamromulan 780590bfa5 Combine Dependencies; Other Improvements
-Removed CPU intensive python based telnet server option
-Removed Micropython
-Renamed AT Telnet Daemon socat-at bridge
-Moved TTL related files not part of the www/cgi-bin directory to /simplefirewall
-Improved Simplefirewall menu, added ability to change TTL
-Combined uninstall and install functions for simpleadmin and dependencies into single functions
2024-02-20 23:44:05 -05:00

30 lines
721 B
Bash

#!/bin/bash
QUERY_STRING=$(echo "${QUERY_STRING}" | sed 's/;//g')
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
if [ "${QUERY_STRING}" ]; then
export IFS="&"
for cmd in ${QUERY_STRING}; do
if [ "$(echo $cmd | grep '=')" ]; then
key=$(echo $cmd | awk -F '=' '{print $1}')
value=$(echo $cmd | awk -F '=' '{print $2}')
eval $key=$value
fi
done
fi
MYATCMD=$(printf '%b\n' "${atcmd//%/\\x}")
if [ -n "${MYATCMD}" ]; then
x=$(urldecode "$atcmd")
runcmd=$(echo -en "$x\r\n" | microcom -t 2000 /dev/ttyOUT)
fi
echo "Content-type: text/plain"
echo $x
echo ""
echo $runcmd