[__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. # This type allows to configure the desired localtime timezone.
timezone_is=$(cat "$__object/explorer/timezone_is") timezone_is=$(cat "$__object/explorer/timezone_is")
timezone_should="$__object_id" timezone_should=$(cat "$__object/parameter/tz")
os=$(cat "$__global/explorer/os") os=$(cat "$__global/explorer/os")
if [ "$timezone_is" = "$timezone_should" ]; then 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 REQUIRED PARAMETERS
------------------- -------------------
None. tz
The name of timezone to set.
OPTIONAL PARAMETERS OPTIONAL PARAMETERS
@ -27,19 +28,24 @@ EXAMPLES
.. code-block:: sh .. code-block:: sh
#Set up Europe/Andorra as our timezone. # Set up Europe/Andorra as our timezone.
__timezone Europe/Andorra __timezone --tz Europe/Andorra
#Set up US/Central as our timezone. # Set up US/Central as our timezone.
__timezone US/Central __timezone --tz US/Central
AUTHORS 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 COPYING
------- -------
Free use of this software is Copyright \(C) 2012-2020 the `AUTHORS`_. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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. # This type allows to configure the desired localtime timezone.
timezone="$__object_id" timezone=$(cat "$__object/parameter/tz")
os=$(cat "$__global/explorer/os") os=$(cat "$__global/explorer/os")
case "$os" in case "$os" in

View file

@ -0,0 +1 @@
tz

View file