[type/__locale_system] RedHat systems on systemd use /etc/locale.conf

This commit is contained in:
Dennis Camera 2020-07-24 10:19:10 +02:00
parent 8b53f35ffa
commit a590504436
1 changed files with 22 additions and 4 deletions

View File

@ -3,6 +3,7 @@
# 2012-2016 Steven Armstrong (steven-cdist at armstrong.cc) # 2012-2016 Steven Armstrong (steven-cdist at armstrong.cc)
# 2016 Carlos Ortigoza (carlos.ortigoza at ungleich.ch) # 2016 Carlos Ortigoza (carlos.ortigoza at ungleich.ch)
# 2016 Nico Schottelius (nico.schottelius at ungleich.ch) # 2016 Nico Schottelius (nico.schottelius at ungleich.ch)
# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -32,8 +33,25 @@ case "$os" in
archlinux) archlinux)
locale_conf="/etc/locale.conf" locale_conf="/etc/locale.conf"
;; ;;
redhat|centos) centos|redhat|scientific)
locale_conf="/etc/sysconfig/i18n" # shellcheck source=/dev/null
version_id=$(. "${__global}/explorer/os_release" && echo "${VERSION_ID:-0}")
if expr "${version_id}" '>=' 7 >/dev/null
then
locale_conf="/etc/locale.conf"
else
locale_conf="/etc/sysconfig/i18n"
fi
;;
fedora)
# shellcheck source=/dev/null
version_id=$(. "${__global}/explorer/os_release" && echo "${VERSION_ID:-0}")
if expr "${version_id}" '>=' 18 >/dev/null
then
locale_conf="/etc/locale.conf"
else
locale_conf="/etc/sysconfig/i18n"
fi
;; ;;
*) *)
echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2 echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
@ -47,9 +65,9 @@ __file "$locale_conf" \
--state exists --state exists
require="__file/$locale_conf" \ require="__file/$locale_conf" \
__key_value "$locale_conf:$__object_id" \ __key_value "$locale_conf:$__object_id" \
--file "$locale_conf" \ --file "$locale_conf" \
--key "$__object_id" \ --key "$__object_id" \
--delimiter = \ --delimiter '=' --exact_delimiter \
--state "$(cat "$__object/parameter/state")" \ --state "$(cat "$__object/parameter/state")" \
--value "$(cat "$__object/parameter/value")" --value "$(cat "$__object/parameter/value")"