aboutsummaryrefslogtreecommitdiffstats
path: root/packages/all-poky-linux/run-postinsts/run-postinsts/latest.pkg_postinst
blob: 7db0f819ca5fe4cf9530b4c8c8d26dc38a3a1f62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
set -e
if systemctl >/dev/null 2>/dev/null; then
	OPTS=""

	if [ -n "$D" ]; then
		OPTS="--root=$D"
	fi

	if [ "enable" = "enable" ]; then
		for service in run-postinsts.service; do
			systemctl ${OPTS} enable "$service"
		done
	fi

	if [ -z "$D" ]; then
		systemctl daemon-reload
		systemctl preset run-postinsts.service

		if [ "enable" = "enable" ]; then
			systemctl --no-block restart run-postinsts.service
		fi
	fi
fi