Files
quectel-rgmii-toolkit/ipk-source/luci-app-atinout-mod/root/sbin/set_at_port.sh
2025-01-19 19:51:23 -05:00

22 lines
480 B
Bash
Executable File

#!/bin/sh
# Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
# Licensed to the GNU General Public License v3.0.
work=false
for port in /dev/ttyUSB*
do
[[ -e $port ]] || continue
gcom -d $port info &> /tmp/testusb
testUSB=`cat /tmp/testusb | grep "Error\|Can't"`
if [ -z "$testUSB" ]; then
work=$port
break
fi
done
rm -rf /tmp/testusb
if [ $work != false ]; then
uci set atinout.@atinout[0].atcport=$work
uci commit atinout
fi