Skip to content

Commit

Permalink
Up to 1.0.3-14072021 | Fix communication port detection script.
Browse files Browse the repository at this point in the history
  • Loading branch information
4IceG authored Jul 14, 2021
1 parent dd7e6d9 commit 31752c7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
6 changes: 4 additions & 2 deletions luci-app-3ginfo-lite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ PKG_NAME:=luci-app-3ginfo-lite
LUCI_TITLE:=LuCI panel for 3ginfo-lite
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+sms-tool
PKG_VERSION:=1.0.3-11072021
PKG_VERSION:=1.0.3-14072021
PKG_RELEASE:=1

include $(TOPDIR)/feeds/luci/luci.mk

define Package/luci-app-3ginfo-lite/postinst
#!/bin/sh
rm -r /tmp/luci-*
rm -rf /tmp/luci-indexcache
rm -rf /tmp/luci-modulecache/
/usr/share/3ginfo-lite/set_3ginfo_port.sh
exit 0
endef

Expand Down
21 changes: 21 additions & 0 deletions luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/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
# MIT License

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.@3ginfo[0].device=$work
uci commit 3ginfo
fi

0 comments on commit 31752c7

Please sign in to comment.