summaryrefslogtreecommitdiffstats
path: root/busybox.pkg/postinst
blob: ae663068659505662bc7165c040932b3b876eebd (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
25
26
27
28
#!/bin/sh

if [ "x${1}" = 'xconfigure' ]; then
	while read link; do
		# 15 is a (temporary?) middle ground: alternatives that should
		# override busybox's have priority 20 (which should maybe be
		# increased to 30), and expect-doc provides a /usr/bin/mkpasswd
		# alternative with priority 10.
		update-alternatives --install "${link}" "${link##*/}" \
			"${link}.busybox" 15
	done </usr/share/busybox/alternatives
	if ! [ -f /etc/rc.policy ]; then
		if [ "x$(cat /etc/proteanos_plat)" = 'xdev' ]; then
			printf 'disabled\n' >/etc/rc.policy
		else
			printf 'enabled\n' >/etc/rc.policy
		fi
	fi
	if [ -f /usr/share/busybox/init-scripts ]; then
		while read -r script enabled; do
			if [ "x${enabled}" = 'xenabled' ]; then
				[ "x${2:+set}" != 'xset' ] && \
					"/etc/init.d/${script}" enable
				"/etc/init.d/${script}" start
			fi
		done </usr/share/busybox/init-scripts
	fi
fi