summaryrefslogtreecommitdiffstats
path: root/defaultenv-2/base/bin/init
blob: 9d7eb2eea750ece0f976fa2ccd43bd9d50a8ec58 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

export PATH=/env/bin

global hostname=generic
global user=none
global autoboot_timeout=3
global boot.default=net
global allow_color=true
global linux.bootargs.base
global linux.bootargs.ip
global linux.bootargs.root
global editcmd=sedit

/env/init/general

if [ -e /env/menu ]; then
	echo -e -n "\nHit m for menu or any other key to stop autoboot: "
else
	echo -e -n "\nHit any key to stop autoboot: "
fi

timeout -a $global.autoboot_timeout -v key
autoboot="$?"

if [ "${key}" = "q" ]; then
	exit
fi

for i in /env/init/*; do
	. $i
done

if [ "$autoboot" = 0 ]; then
	boot
fi

if [ -e /env/menu ]; then
	if [ "${key}" != "m" ]; then
		echo -e "\ntype exit to get to the menu"
		sh
	fi
	/env/menu/mainmenu
fi