auto-timezone: add new package#29233
Conversation
A hotplug script to auto set the timezone based on the IP address Signed-off-by: Renn Akaza <openwrt.org-auto-timezone@akaza.ren>
fix indentation Signed-off-by: Renn Akaza <openwrt.org-auto-timezone@akaza.ren>
update makefile indentation Signed-off-by: Renn Akaza <openwrt.org-auto-timezone@akaza.ren>
revert makefile's indentation Signed-off-by: Renn Akaza <openwrt.org-auto-timezone@akaza.ren>
minor formatting on the script Signed-off-by: Renn Akaza <openwrt.org-auto-timezone@akaza.ren>
avoid creating new functions unnecessarily Signed-off-by: Renn Akaza <openwrt.org-auto-timezone@akaza.ren>
|
I like the idea, especially as I'm building a Banana Pi-R4 Pro to go in the family camper, but I'm wondering if using We have a T-Mobile 5G card with a static address (so that won't change) and Starlink Mini so our address is CGNAT'd and meaningless (we use |
| exit 0 | ||
| fi | ||
|
|
||
| log() { |
There was a problem hiding this comment.
I would pass priority as well.
There was a problem hiding this comment.
I added two functions log_info and log_error to handle the priorities in 1dbe849.
| Hotplug script to automatically configure the timezone UCI settings based on the IP address. | ||
|
|
||
| The user needs to set their own endpoint to get the IANA timezone string, e.g.: | ||
| uci set auto-timezone.config.endpoint="https://domain.tld/json" |
There was a problem hiding this comment.
Could this be made more clear?
There was a problem hiding this comment.
I updated the description on the expected response from the endpoint in 1dbe849. Please let me know if you expect something else.
address comments. 1. add log info/error 2. wrap posix timezone convertion in a function 3. update package description Signed-off-by: Renn Akaza <openwrt.org-auto-timezone@akaza.ren>
I don't have any external GPS hardware to test it so it would be hard... |
Various 5G cards will provide GPS or A-GPS, as well as some $20 USB fobs. |
Can we leave for later if there are enough people needing it? I feel like it's overkill to let the router to deal with GPS. |
📦 Package Details
Maintainer: none, new package
Description:
A hotplug script to auto set the timezone based on the IP address. It doesn't bring the endpoint by default to avoid promoting any service, so the user will need to set their own at
auto-timezone.config.endpoint. Triggered once when the device is online.I tested with
https://ipinfo.io/timezone. It works on both rebooting and restarting the interface.🧪 Run Testing Details
✅ Formalities
If your PR contains a patch:
git am(e.g., subject line, commit description, etc.)
We must try to upstream patches to reduce maintenance burden.