cdist-contrib/type/__runit/gencode-remote
evilham 2038244ec4 [__runit*] Add support for Debian/Devuan
Apparently these types were only supporting FreeBSD, this brings in support for
Debian and Devuan by taking advantage of
https://packages.debian.org/bullseye/runit-run
2021-10-30 10:40:01 +02:00

29 lines
613 B
Bash
Executable file

#!/bin/sh -e
os="$(cat "${__global}/explorer/os")"
if [ "${os}" != "freebsd" ]; then
exit
fi
# FreeBSD-specific
svdir="/var/service"
svdir_exists="$(cat "${__object}/explorer/svdir-exists")"
runit_etc="$(cat "${__object}/explorer/runit-etc")"
if [ -z "${svdir_exists}" ]; then
echo "mkdir '${svdir}'"
sv_restart="YES"
fi
if [ -z "${runit_etc}" ]; then
echo "cp -R '/usr/local/etc/runit' '/etc/runit'"
sv_restart="YES"
fi
if grep -q "^__key_value/runsvdir_enable" "${__messages_in}"; then
sv_restart="YES"
fi
if [ -n "${sv_restart}" ]; then
echo "service runsvdir restart || service runsvdir start"
fi