Compare commits
1 commit
master
...
email_alia
Author | SHA1 | Date | |
---|---|---|---|
|
81164eb0c6 |
7 changed files with 83 additions and 16 deletions
21
cdist/conf/type/__email_alias/explorer/newaliases
Executable file
21
cdist/conf/type/__email_alias/explorer/newaliases
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2023 Simon Walter (simon@the-oposite-of-implicit.techonolgy)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
# cdist is free software: 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.
|
||||
#
|
||||
# cdist is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
if $(command -v newaliases); then echo yes; else echo no; fi
|
23
cdist/conf/type/__email_alias/gencode-remote
Executable file
23
cdist/conf/type/__email_alias/gencode-remote
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2023 Simon Walter (simon at explicit dot technology)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
# cdist is free software: 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.
|
||||
#
|
||||
# cdist is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
if [ "$(cat "$__object/explorer/newaliases")" = "yes" ]; then
|
||||
echo "newaliases"
|
||||
fi
|
37
cdist/conf/type/__email_alias/manifest
Executable file
37
cdist/conf/type/__email_alias/manifest
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2023 Simon Walter (simon at explicit dot technology)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
# cdist is free software: 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.
|
||||
#
|
||||
# cdist is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
os="$(cat "$__global/explorer/os")"
|
||||
case "$os" in
|
||||
debian|ubuntu|devuan)
|
||||
if [ "$(cat "$__object/explorer/newaliases")" = "yes" ]; then
|
||||
for="$(cat "$__object/parameter/for")"
|
||||
__key_value $__object_id --file /etc/aliases --delimiter ":" --value "$for"
|
||||
else
|
||||
echo "'newaliases' command not found. Please install the 'default-mta'\
|
||||
pkg or otherwise provide the 'newaliases' command." >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Don't know how to manage aliases on: $os. Please contribute." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
1
cdist/conf/type/__email_alias/parameter/required
Normal file
1
cdist/conf/type/__email_alias/parameter/required
Normal file
|
@ -0,0 +1 @@
|
|||
for
|
|
@ -34,12 +34,3 @@ case "$os" in
|
|||
echo "echo \"$timezone_should\" > /etc/timezone"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$os" in
|
||||
openwrt)
|
||||
cat <<EOF
|
||||
uci set system.@system[0].timezone="$timezone_should"
|
||||
uci commit
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -53,10 +53,7 @@ case "$os" in
|
|||
--file /etc/sysconfig/clock \
|
||||
--delimiter '=' \
|
||||
--value "\"$timezone\""
|
||||
;;
|
||||
openwrt)
|
||||
: # Uses gencode-remote
|
||||
;;
|
||||
;;
|
||||
*)
|
||||
echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
|
||||
echo "Please contribute an implementation for it if you can." >&2
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
Changelog
|
||||
---------
|
||||
|
||||
next:
|
||||
* Type __timezone: Add support for OpenWRT (Nico Schottelius)
|
||||
|
||||
7.0.1:
|
||||
* Core: Remove double definition of scan parser (Nico Schottelius)
|
||||
* Type __apt_mark: Narrow down grep for hold packages (marcoduif)
|
||||
|
|
Loading…
Reference in a new issue