You are not logged in.

#1 2015-12-25 06:50:05

StefanHamminga
Member
From: Groningen, The Netherlands
Registered: 2015-12-24
Posts: 1
Website

Automatic timezone setting script

I've created a small server and client script to automatically set the proper timezone for a given public IP address. I thought it might be useful for others too.

The (Node.js) server can be hosted on it's own or behind a reverse proxy like NGINX. My own server is publicly available and located at: prjct.net/tzbounce.

The repository script client.sh, when placed in `/etc/NetworkManager/dispatcher.d/`, will request a new GeoIP determined timezone upon connecting to a network.

The script is pretty basic right now (client side caching, etc, aren't yet implemented) but works well for me.

Offline

#2 2015-12-25 10:30:05

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: Automatic timezone setting script

dhcpcd has been doing this for ..... well a long while. But properly, based on DHCP, not some IP range. After all, which timezone is 192.168.x.x in? Also, while you may get LAN connectivity in some places, there is no guarantee of full internet access.

https://tools.ietf.org/html/rfc4833
http://roy.marples.name/projects/dhcpcd … 06f1730fef

Offline

Board footer

Powered by FluxBB