summaryrefslogtreecommitdiffstats
path: root/busybox.pkg/postinst
blob: fbdd6b47aee0318e5b16860ae134a46d6b59c5c4 (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
29
30
31
#!/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 ! [ -e /etc/rc.policy ]; then
		if [ "x$(cat /etc/proteanos_plat)" = 'xdev' ]; then
			printf 'disabled' >/etc/rc.policy
		else
			printf 'enabled' >/etc/rc.policy
		fi
	fi
	if [ -e /usr/share/busybox/init-scripts ]; then
		while read script; do
			"/etc/init.d/${script}" enable
			"/etc/init.d/${script}" start
		done </usr/share/busybox/init-scripts
	fi
	if [ -d /etc/network ] && ! [ -f /etc/network/interfaces ]; then
		exec 3>/etc/network/interfaces
		printf 'auto lo\niface lo inet loopback\n\n' >&3
		for iface in /sys/class/net/eth*; do
			iface="${iface#*/}"
			printf 'auto %s\niface %s inet dhcp\n\n' \
				"${iface}" "${iface}" >&3
		done
		exec 3>&-
	fi
fi