The onion tool
-
Are the changes made using the command line tool
onion
persistent? The help is silent about this.
-
@Claude-Robitaille I have no idea what the script does as I stopped using it ages ago. I prefer to use uci :
uci set system.@system[0].timezone='AEST-10AEDT,M10.1.0,M4.1.0/3'
uci commit systemThis sets the timezone of GMT+10 (Sydney AEST)
-
To answer my question: yes, it is persistent. But since it is not clearly stipulated (at least in the help) this should not be rely upon....like anything unspecified!!
-
@Claude-Robitaille hence my point. uci is clearly documented and proven. I don't like the sand moving under my feet.
-
The
onion
script is meant to provide a user-friendly wrapper around uci for setting the timezone. The changes are persistent.The script is open source and can be found on GitHub if you're curious: https://github.com/OnionIoT/Onion-Scripts/blob/master/onion.sh
-
@Lazar-Demin Or you could just understand uci. I like the idea of the "onion" script but I expect most newbies don't realise it is just a script. Once you understand the nomenclature of uci it's pretty stright forward anyway.
-
@crispyoz Agreed, uci is straight forward and very powerful.
The timezone strings are a different story - very complex and not useful to learn.I see what you're saying though, maybe in the next version we'll add a blurb in the onion script help output that the source is available on github.
-
@Claude-Robitaille Yes, the time(zone) settings - made by the
onion
script - are persistent.
But the changes are not able to survive a Factory Reset, afirstboot
or asysupgrade -n <image file>
command of course.
-
@crispyoz said in The onion tool:
I prefer to use uci :
uci set system.@system[0].timezone='AEST-10AEDT,M10.1.0,M4.1.0/3'
uci commit systemThis sets the timezone of GMT+10 (Sydney AEST)
Almost.
One more command
eg. anecho 'AEST-10AEDT,M10.1.0,M4.1.0/3' > /etc/TZ
is missing otherwise you have toreboot
your device.See also:
cat /usr/bin/onion
Timezone Functions
-
@Lazar-Demin Usually we know our ("time zone") location - so the command can be a little bit simpler:
onion time set $(onion time list | grep my_location)
The
echo "$tz" > /tmp/TZ
line in the /usr/bin/onion script is a redundancy.I think the Time Zones table (the list of available timezones) should be in a separate file.
-
@György-Farkas Yes you are correct but I run ntpclient so I don't need restart