You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this script. I just set it up so it automatically sets the timezone when the network becomes available. If you find it useful and want to distribute some version of it with your script, here's what I did:
Create /etc/NetworkManager/dispatcher.d/update-timezone.sh with
#! /bin/bash
# Automatically set time zone when connected to the network
iface=$1
action=$2
#logger "tzupdate $iface $action"
if [[ $iface == wlan0 && $action == up ]]; then
tz=$(tzupdate -s 1 -p 2>/dev/null)
if [[ -n $tz && -r /usr/share/zoneinfo/$tz ]]; then
timedatectl set-timezone $tz
fi
fi
(Change $iface == wlan0 to $iface != lo if desired, and don't forget to make the script executable.)
This only works for systems that use NetworkManager.
GI
The text was updated successfully, but these errors were encountered:
Thanks for this script. I just set it up so it automatically sets the timezone when the network becomes available. If you find it useful and want to distribute some version of it with your script, here's what I did:
Create
/etc/NetworkManager/dispatcher.d/update-timezone.sh
with(Change
$iface == wlan0
to$iface != lo
if desired, and don't forget to make the script executable.)This only works for systems that use NetworkManager.
GI
The text was updated successfully, but these errors were encountered: