2021-01-11 13:10:55 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2021-10-30 08:40:01 +00:00
|
|
|
|
|
|
|
os="$(cat "${__global}/explorer/os")"
|
|
|
|
if [ "${os}" != "freebsd" ]; then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
# FreeBSD-specific
|
2021-01-11 13:10:55 +00:00
|
|
|
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
|