-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDEINSTALL
62 lines (53 loc) · 1.38 KB
/
DEINSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# $NetBSD: DEINSTALL,v 1.5 2022/12/17 21:36:11 triaxx Exp $
RCDBOOT_STYLE=@RCDBOOT_STYLE@
RCD_SCRIPTS_DIR=@RCD_SCRIPTS_DIR@
UNPRIVILEGED=@UNPRIVILEGED@
EGDIR=@EGDIR@
case "${STAGE}" in
DEINSTALL)
case "${RCDBOOT_STYLE}" in
darwin-launchd)
if [ "x${UNPRIVILEGED}" = "xyes" ] ; then
${RM} -f $HOME/Library/LaunchAgents/org.pkgsrc.rc.d-boot.plist
fi
;;
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