forked from ungleich-public/cdist
explore state of init script on archlinux
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
f290b94d7b
commit
aae67652e9
1 changed files with 17 additions and 0 deletions
|
@ -29,6 +29,23 @@ name="$__object_id"
|
|||
state="present"
|
||||
|
||||
case "$os" in
|
||||
archlinux)
|
||||
# convert bash array to shell
|
||||
daemons=$(grep ^DAEMONS /etc/rc.conf | sed -e 's/^.*=(//' -e 's/)$//')
|
||||
|
||||
# absent, as long as not found
|
||||
state="absent"
|
||||
|
||||
# iterate, last one wins.
|
||||
for daemon in $daemons; do
|
||||
if [ "$daemon" = "$name" -o "$daemon" = "@${name}" ]; then
|
||||
state="present"
|
||||
elif [ "$daemon" = "!${name}" ]; then
|
||||
state="absent"
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
debian|ubuntu)
|
||||
[ -f "/etc/rc$runlevel.d/S"??"$name" ] || state="absent"
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue