aboutsummaryrefslogtreecommitdiffstats
path: root/packages/cortexa57-poky-linux/rng-tools/rng-tools/latest.pkg_postinst
blob: b375476fd711d2858b960669ad4102705b263821 (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 rng-tools.service; do
			systemctl ${OPTS} enable "$service"
		done
	fi

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

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