Skip to content

Commit 36793d5

Browse files
authored
Up to 1.0.69-20240427
I updated huawei hilink script to the current look of the package
1 parent 5b31626 commit 36793d5

File tree

3 files changed

+47
-17
lines changed

3 files changed

+47
-17
lines changed

luci-app-3ginfo-lite/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ MAINTAINER:=Rafał Wabik <4Rafal@gmail.com>
1212
LUCI_DESCRIPTION:=LuCI JS interface for the 3ginfo-lite. The package allows you to view the parameters of the mobile internet connection.
1313
LUCI_DEPENDS:=+sms-tool +comgt +kmod-usb-serial-option
1414
LUCI_PKGARCH:=all
15-
PKG_VERSION:=1.0.68-20240422
15+
PKG_VERSION:=1.0.69-20240427
1616

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

luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ simDialog: baseclass.extend({
932932
'class': 'ifacebadge',
933933
'title': null,
934934
'id': 'simv',
935-
'style': 'visibility: hidden; max-width:3em; display: inline-block;',
935+
'style': 'visibility: hidden; margin:0 auto; padding: 4px;',
936936
'click': ui.createHandlerFn(this, function() {
937937
return upSIMDialog.show();
938938
}),
@@ -942,7 +942,7 @@ simDialog: baseclass.extend({
942942
E('div', { 'class': 'cbi-tooltip-container' }, [
943943
E('img', {
944944
'src': L.resource('icons/sim1m.png'),
945-
'style': 'width:24px; height:auto; padding: 0px',
945+
'style': 'width:24px; height:auto; padding: 1%; margin:0 auto;',
946946
'title': _(''),
947947
'class': 'middle',
948948
}),

luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/hilink/huawei_hilink.sh

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ PV=$(cat /sys/kernel/debug/usb/devices)
4949
PVCUT=$(echo $PV | awk -F 'Vendor=12d1 ProdID=' '{print $2}' | cut -c-1108)
5050
if echo "$PVCUT" | grep -q "Driver=qmi_wwan"
5151
then
52-
PROTO="QMI"
52+
PROTO="qmi"
5353
elif echo "$PVCUT" | grep -q "Driver=cdc_mbim"
5454
then
55-
PROTO="MBIM"
55+
PROTO="mbim"
5656
elif echo "$PVCUT" | grep -q "Driver=cdc_ether"
5757
then
58-
PROTO="ECM"
58+
PROTO="ecm"
5959
elif echo "$PVCUT" | grep -q "Driver=huawei_cdc_ncm"
6060
then
61-
PROTO="NCM"
61+
PROTO="ncm"
6262
fi
6363

6464
RSSI=$(getvalue device-signal rssi)
@@ -159,6 +159,16 @@ if [ -n "$FW" ]; then
159159
FW="$rev / $FW"
160160
fi
161161

162+
if [ -z "$FW" ]
163+
then
164+
FW='-'
165+
fi
166+
167+
if [ -z "$TEMP" ]
168+
then
169+
TEMP='-'
170+
fi
171+
162172
COPSA=$(getvaluen net-current-plmn Numeric)
163173
COPSB=$(echo "${COPSA}" | cut -c1-3)
164174
COPSC=$(echo -n $COPSA | tail -c 2)
@@ -167,9 +177,12 @@ COPS_MNC="$COPSC"
167177

168178
COPS=$(getvalue net-current-plmn ShortName)
169179

170-
if [[ -n "$COPS" ]]; then
171-
COPS=$(awk -F[\;] '/^'$COPS';/ {print $3}' $RES/mccmnc.dat)
172-
LOC=$(awk -F[\;] '/^'$COPS';/ {print $2}' $RES/mccmnc.dat)
180+
if [[ $COPSA =~ ^[0-9]+$ ]]; then
181+
if [ -z "$COPS" ]
182+
then
183+
COPS=$(awk -F[\;] '/^'$COPSA';/ {print $3}' $RES/mccmnc.dat | xargs)
184+
fi
185+
LOC=$(awk -F[\;] '/^'$COPSA';/ {print $2}' $RES/mccmnc.dat)
173186
fi
174187

175188
# operator location from temporary config
@@ -179,15 +192,27 @@ if [ -e "$LOCATIONFILE" ]; then
179192
LOC=$(cat $LOCATIONFILE)
180193
if [ -n "$LOC" ]; then
181194
LOC=$(cat $LOCATIONFILE)
182-
else
183-
echo "-" > /tmp/location
195+
if [[ $LOC == "-" ]]; then
196+
rm $LOCATIONFILE
197+
LOC=$(awk -F[\;] '/^'$COPSA';/ {print $2}' $RES/mccmnc.dat)
198+
if [ -n "$LOC" ]; then
199+
echo "$LOC" > /tmp/location
200+
fi
201+
else
202+
LOC=$(awk -F[\;] '/^'$COPSA';/ {print $2}' $RES/mccmnc.dat)
203+
if [ -n "$LOC" ]; then
204+
echo "$LOC" > /tmp/location
205+
fi
206+
fi
184207
fi
185208
else
186-
LOC=$(awk -F[\;] '/^'$COPS_NUM';/ {print $2}' $RES/mccmnc.dat)
187-
if [ -n "$LOC" ]; then
188-
echo "$LOC" > /tmp/location
189-
else
190-
echo "-" > /tmp/location
209+
if [[ "$COPS_MCC$COPS_MNC" =~ ^[0-9]+$ ]]; then
210+
if [ -n "$LOC" ]; then
211+
LOC=$(awk -F[\;] '/^'$COPS_MCC$COPS_MNC';/ {print $2}' $RES/mccmnc.dat)
212+
echo "$LOC" > /tmp/location
213+
else
214+
echo "-" > /tmp/location
215+
fi
191216
fi
192217
fi
193218

@@ -213,6 +238,11 @@ then
213238
CID_HEX='-'
214239
fi
215240

241+
if [ -z "$CID_DEC" ]
242+
then
243+
[ -n "$CID_HEX" ] && CID_DEC=$(echo $((0x$CID_HEX)))
244+
fi
245+
216246
rm $cookie
217247
break
218248

0 commit comments

Comments
 (0)