mirror of
https://github.com/4IceG/luci-app-3ginfo-lite.git
synced 2026-04-25 19:35:53 +03:00
[GH-ISSUE #53] Change 192.168. to IP check #42
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/luci-app-3ginfo-lite#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GektorUA on GitHub (Dec 2, 2023).
Original GitHub issue: https://github.com/4IceG/luci-app-3ginfo-lite/issues/53
github.com/4IceG/luci-app-3ginfo-lite@5e2542a9be/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh (L334C42-L334C42)My propose to change
grep -q "192.168."to something more universal, like:grep -qE '^([0-9]{1,3}\.){3}[0-9]{1,3}$'@4IceG commented on GitHub (Dec 3, 2023):
Hi @GektorUA ,
I changed this piece of code.
@GektorUA commented on GitHub (Dec 7, 2023):
I saw i reverted changes, something wrong with regular expression? Why i am asking - on some Hi-Link firmwares there is possible to change all DHCP segment, not only 192.168.0.0/16, and sometimes users using something look like 10.0.0.0/8 172.16.0.0/12 , and in that case 3ginfo doesn't work with that DHCP modem settings. Maybe it's acceptable to do this in more simple and clear way:
grep -q "^192.168.\|^172.16\|^10."?
@4IceG commented on GitHub (Dec 7, 2023):
HI @GektorUA ,
I rolled back changes because I received an error report https://github.com/4IceG/luci-app-3ginfo-lite/issues/54 that after making the changes, 3ginfo stopped showing data from the modem. That's why I preferred to leave something that works.
@GektorUA commented on GitHub (Dec 7, 2023):
Seems that not all versions of OpenWrt grep working good with regular expressions, so i have propose simple 100% working solution. In my condition
grep -q "192.168."doesn't work because i am using more then one modem and not in 192.168.0.0/24 subnet.