[GH-ISSUE #33] Huawei E3372H (stick): 12d11506: line 88: syntax error: unexpected "else" #23

Closed
opened 2026-03-04 11:57:41 +03:00 by kerem · 2 comments
Owner

Originally created by @patrakov on GitHub (Jan 21, 2023).
Original GitHub issue: https://github.com/4IceG/luci-app-3ginfo-lite/issues/33

root@OpenWrt:/tmp# /usr/share/3ginfo-lite/3ginfo.sh 
/usr/share/3ginfo-lite/3ginfo.sh: /usr/share/3ginfo-lite/3ginfo-addon/12d11506: line 88: syntax error: unexpected "else"
root@OpenWrt:/tmp# cat /etc/config/3ginfo 

config 3ginfo
	option pbwidth '33'
	option website 'https://lteitaly.it/internal/map.php#bts='
	option network 'wwan0'
	option device '/dev/ttyUSB0'

The file in question contains:

XFR=$(sms_tool -d $DEVICE at "at^hfreqinfo?")
if [ -z "$XFR" ]
then
      # Huawei E3272 
else
...
fi
# DL / UL / Band

The problem is that the shell requires at least one command between "then" and "else", and your code only has a comment, which is not a command. Adding a ":" on a line by itself helps.

Originally created by @patrakov on GitHub (Jan 21, 2023). Original GitHub issue: https://github.com/4IceG/luci-app-3ginfo-lite/issues/33 ``` root@OpenWrt:/tmp# /usr/share/3ginfo-lite/3ginfo.sh /usr/share/3ginfo-lite/3ginfo.sh: /usr/share/3ginfo-lite/3ginfo-addon/12d11506: line 88: syntax error: unexpected "else" root@OpenWrt:/tmp# cat /etc/config/3ginfo config 3ginfo option pbwidth '33' option website 'https://lteitaly.it/internal/map.php#bts=' option network 'wwan0' option device '/dev/ttyUSB0' ``` The file in question contains: ``` XFR=$(sms_tool -d $DEVICE at "at^hfreqinfo?") if [ -z "$XFR" ] then # Huawei E3272 else ... fi # DL / UL / Band ``` The problem is that the shell requires at least one command between "then" and "else", and your code only has a comment, which is not a command. Adding a ":" on a line by itself helps.
kerem closed this issue 2026-03-04 11:57:41 +03:00
Author
Owner

@4IceG commented on GitHub (Jan 21, 2023):

Ok, thanks @patrakov for reporting the bug. I see that I have to check next time on a working modem, because the interpreter can be wrong. I'll fix it in the next release.

<!-- gh-comment-id:1399328234 --> @4IceG commented on GitHub (Jan 21, 2023): Ok, thanks @patrakov for reporting the bug. I see that I have to check next time on a working modem, because the interpreter can be wrong. I'll fix it in the next release.
Author
Owner

@4IceG commented on GitHub (Jan 25, 2023):

It should be ok now, I changed the logic of the condition.

P.S.
I'm waiting to compile the package from sources.

<!-- gh-comment-id:1403866248 --> @4IceG commented on GitHub (Jan 25, 2023): It should be ok now, I changed the logic of the condition. P.S. I'm waiting to compile the package from sources.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/luci-app-3ginfo-lite#23
No description provided.