Skip to content

Commit

Permalink
Up to 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
4IceG authored Mar 19, 2021
1 parent b2e23e3 commit 04c3fc4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions luci-app-3ginfo/root/etc/uci-defaults/set_3ginfo_port.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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 3ginfo.device=$work
uci commit 3ginfo
fi

0 comments on commit 04c3fc4

Please sign in to comment.