Compare commits

..

1 commit

6 changed files with 12 additions and 66 deletions

View file

@ -37,7 +37,7 @@ if [ "$init" = 'systemd' ]; then
else
case "$os" in
debian|openwrt|devuan)
openwrt|devuan)
state="absent"
for file in "/etc/rc$runlevel.d/S"??"$name"
do
@ -48,33 +48,12 @@ else
fi
done
;;
ubuntu)
state="absent"
for file in "/etc/rc$runlevel.d/S"??"$name"
do
if [ -f "$file" ]
then
state="present"
break
fi
done
[ -f "/etc/init/${name}.conf" ] && state="present"
;;
amazon|scientific|centos|fedora|owl|redhat)
owl)
state=$(chkconfig --level "$runlevel" "$name" || echo absent)
[ "$state" ] || state="present"
;;
suse)
# check for target if set, usable for boot. services in runlevel B
if [ "$target_runlevel" != 'default' ]; then
runlevel="$target_runlevel"
fi
# suses chkconfig has the same name, but works different ...
state=$(chkconfig --check "$name" "$runlevel" || echo absent)
[ "$state" ] || state="present"
;;
gentoo|alpine)
state="absent"
for d in /etc/runlevels/*; do
@ -84,10 +63,12 @@ else
fi
done
;;
freebsd)
state="absent"
service -e | grep "/$name$" && state="present"
;;
openbsd)
state='absent'
# OpenBSD 5.7 and higher

View file

@ -36,24 +36,10 @@ case "$state_should" in
present)
if [ "$init" = 'systemd' ]; then
# this handles ALL linux distros with systemd
# e.g. archlinux, gentoo in some cases, new RHEL and SLES versions
# e.g. debian, fedora, archlinux, gentoo in some cases, new RHEL and SLES versions
echo "systemctl -q enable '$name'"
else
case "$os" in
debian)
case "$os_version" in
[1-7]*)
echo "update-rc.d '$name' defaults >/dev/null"
;;
8*)
echo "systemctl enable '$name'"
;;
*)
echo "Unsupported version $os_version of $os" >&2
exit 1
;;
esac
;;
devuan)
echo "update-rc.d '$name' defaults >/dev/null"
;;
@ -62,7 +48,7 @@ case "$state_should" in
echo "rc-update add '$name' '$target_runlevel'"
;;
amazon|scientific|centos|fedora|owl|redhat|suse)
owl)
echo "chkconfig '$name' on"
;;
@ -73,10 +59,6 @@ case "$state_should" in
echo "'/etc/init.d/$name' enable || [ -f /etc/rc.d/S??'$name' ]"
;;
ubuntu)
echo "update-rc.d '$name' defaults >/dev/null"
;;
freebsd)
: # handled in manifest
;;
@ -102,7 +84,7 @@ case "$state_should" in
else
case "$os" in
debian|ubuntu|devuan)
devuan)
echo "update-rc.d -f '$name' remove"
;;
@ -110,7 +92,7 @@ case "$state_should" in
echo "rc-update del '$name' '$target_runlevel'"
;;
centos|fedora|owl|redhat|suse)
owl)
echo "chkconfig '$name' off"
;;

View file

@ -11,10 +11,6 @@ DESCRIPTION
This cdist type allows you to enable or disable stuff to be started
at boot of your operating system.
Warning: This type has not been tested intensively and is not fully
supported.
REQUIRED PARAMETERS
-------------------
None.
@ -24,6 +20,7 @@ OPTIONAL PARAMETERS
-------------------
state
Either "present" or "absent", defaults to "present"
target_runlevel
Runlevel which should be modified, defaults to "default" (only used on gentoo systems).
@ -51,6 +48,7 @@ SEE ALSO
AUTHORS
-------
Nico Schottelius <nico-cdist--@--schottelius.org>
Timothée Floure <work--@--tfloure.ch>
COPYING

View file

@ -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

View file

@ -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

View file

@ -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)