Rather new to coding, looking for a little help with having a variable output to a local html file. Both script and html are on the same machine. Script pulls signal level from a modem and I would like to have that displayed to a local html loading screen.
Signal Script:
#!/bin/bash
MODEM=/dev/ttyUSB3
MODEMCMD=AT+CSQ
{
echo -ne "$MODEMCMD"'\r\n' > "$MODEM"
if [ $? -eq 1 ]
then
echo "error";
exit;
fi
{
while read -t 1
do
if [[ $REPLY == +CSQ* ]]
then
arr1=$(echo "$REPLY" | cut -d' ' -f2)
arr2=$(echo "$arr1" | cut -d',' -f1)
echo "$arr2"
exit;
fi
done
echo "error";
} <"$MODEM"
} 2>/dev/null
Would like the output of this to display in a table on my html. Thanks!