pkgsrc/pkgtools/rc.d-boot/DEINSTALL
schmonz bd924c2115 Add support for Linux sysvinit, both Debian and Red Hat styles. Improve
systemd detection. Tested on CentOS 6 (Red Hat init) and 7 (systemd),
Devuan (Debian init), and Debian 9 (systemd).

Add RCDBOOT_STYLE to BUILD_DEFS.

Bump version.
2018-12-28 20:24:02 +00:00

57 lines
1.2 KiB
Text

# $NetBSD: DEINSTALL,v 1.4 2018/12/28 20:24:02 schmonz Exp $
RCDBOOT_STYLE=@RCDBOOT_STYLE@
RCD_SCRIPTS_DIR=@RCD_SCRIPTS_DIR@
case "${STAGE}" in
DEINSTALL)
case "${RCDBOOT_STYLE}" in
darwin-launchd)
;;
freebsd-native)
;;
linux-systemd)
systemctl disable pkgsrc-rc.d-boot.service
;;
linux-sysv-debian)
update-rc.d pkgsrc-rc.d-boot remove
;;
linux-sysv-redhat)
chkconfig pkgsrc-rc.d-boot off
chkconfig --del pkgsrc-rc.d-boot
;;
netbsd-native)
;;
openbsd-rcd)
short_order=$(rc.d-boot list | ${SED} -e "s|^${RCD_SCRIPTS_DIR}/||" | ${GREP} -v '^[A-Z]*$')
for _svc in ${short_order}; do
# lifted from OpenBSD 6.4 /usr/sbin/rcctl
${SED} "/^pkg_scripts[[:>:]]/{s/[[:<:]]${_svc}[[:>:]]//g
s/['\"]//g;s/ *= */=/;s/ */ /g;s/ $//;/=$/d;}" \
< /etc/rc.conf.local \
> /etc/rc.conf.local.tmp \
&& ${MV} /etc/rc.conf.local.tmp /etc/rc.conf.local
done
;;
esac
case "${RCDBOOT_STYLE}" in
*-native)
;;
*)
${CAT} <<EOF
===========================================================================
pkgsrc-provided rc.d scripts will no longer be started at boot.
If you wish to stop them, please do so now.
===========================================================================
EOF
;;
esac
;;
esac