|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
|
|
|
|
# 2012 Nico Schottelius (nico-cdist at schottelius.org)
|
|
|
|
|
# 2012-2013 Nico Schottelius (nico-cdist at schottelius.org)
|
|
|
|
|
#
|
|
|
|
|
# This file is part of cdist.
|
|
|
|
|
#
|
|
|
|
@ -32,8 +32,7 @@ case "$state_should" in
|
|
|
|
|
present)
|
|
|
|
|
case "$os" in
|
|
|
|
|
archlinux)
|
|
|
|
|
echo "sed 's/^\\(DAEMONS=.*\\))/\\1 $name)/' /etc/rc.conf > /etc/rc.conf.cdist-tmp"
|
|
|
|
|
echo "mv /etc/rc.conf.cdist-tmp /etc/rc.conf"
|
|
|
|
|
echo "systemctl enable \"$name\""
|
|
|
|
|
;;
|
|
|
|
|
debian|ubuntu)
|
|
|
|
|
echo "update-rc.d \"$name\" defaults >/dev/null"
|
|
|
|
@ -65,10 +64,7 @@ case "$state_should" in
|
|
|
|
|
absent)
|
|
|
|
|
case "$os" in
|
|
|
|
|
archlinux)
|
|
|
|
|
# Replace a) at the beginning b) in the middle c) end d) only
|
|
|
|
|
# Support @name as well...makes it more ugly, but well...
|
|
|
|
|
echo "sed /etc/rc.conf -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name /\\1/' -e 's/^\\(DAEMONS=(.* \\)@\\{0,1\\}$name \\(.*\\)/\\1\\2/' -e 's/^\\(DAEMONS=(.*\\) @\\{0,1\\}$name)/\\1)/' -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name)/\\1)/' > /etc/rc.conf.cdist-tmp"
|
|
|
|
|
echo "mv /etc/rc.conf.cdist-tmp /etc/rc.conf"
|
|
|
|
|
echo "systemctl disable \"$name\""
|
|
|
|
|
;;
|
|
|
|
|
debian|ubuntu)
|
|
|
|
|
echo update-rc.d -f \"$name\" remove
|
|
|
|
|