summaryrefslogtreecommitdiffstats
path: root/busybox.pkg/postinst
blob: 9f23a39b267c22285c827d33df7bcf3beb077ff0 (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

if [ "x${1}" = 'xconfigure' ]; then
	while read link name prio; do
		update-alternatives --install "${link}" "${name}" \
			"${link}.busybox" "${prio}"
	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