[__timezone] Make type singleton

This commit is contained in:
Dennis Camera 2020-07-27 10:55:28 +02:00
parent 8b53f35ffa
commit d26c36914a
5 changed files with 17 additions and 10 deletions

View file

@ -22,7 +22,7 @@
# This type allows to configure the desired localtime timezone.
timezone_is=$(cat "$__object/explorer/timezone_is")
timezone_should="$__object_id"
timezone_should=$(cat "$__object/parameter/tz")
os=$(cat "$__global/explorer/os")
if [ "$timezone_is" = "$timezone_should" ]; then

View file

@ -14,7 +14,8 @@ This type creates a symlink (/etc/localtime) to the selected timezone
REQUIRED PARAMETERS
-------------------
None.
tz
The name of timezone to set.
OPTIONAL PARAMETERS
@ -27,19 +28,24 @@ EXAMPLES
.. code-block:: sh
#Set up Europe/Andorra as our timezone.
__timezone Europe/Andorra
# Set up Europe/Andorra as our timezone.
__timezone --tz Europe/Andorra
#Set up US/Central as our timezone.
__timezone US/Central
# Set up US/Central as our timezone.
__timezone --tz US/Central
AUTHORS
-------
Ramon Salvadó <rsalvado--@--gnuine--dot--com>
| Steven Armstrong <steven-cdist--@--armstrong.cc>
| Nico Schottelius <nico-cdist--@--schottelius.org>
| Ramon Salvadó <rsalvado--@--gnuine--dot--com>
| Dennis Camera <dennis.camera--@--ssrq-sds-fds.ch>
COPYING
-------
Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
Copyright \(C) 2012-2020 the `AUTHORS`_. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

View file

@ -22,7 +22,7 @@
#
# This type allows to configure the desired localtime timezone.
timezone="$__object_id"
timezone=$(cat "$__object/parameter/tz")
os=$(cat "$__global/explorer/os")
case "$os" in

View file

@ -0,0 +1 @@
tz

View file