1## The system's main CD boot script.
2
3##
4## Some functions used by the main script
5##
6
7# launch <executable path> [thread to wait for]
8
9launch() {
10	if [ -f "/boot/$1" ]
11	then
12		"/boot/$1" &
13		[ "$2" != "" ] && waitfor "$2"
14		return 1
15	else
16		echo There is no "$1"
17	fi
18	return 0
19}
20
21# launchscript <script path>
22
23launchscript() {
24	if [ -f "/boot/$1" ]
25	then
26		. "/boot/$1"
27	fi
28}
29
30# runprog <executable path>
31
32runprog() {
33	if [ -f "/boot/$1" ]
34	then
35		"/boot/$1"
36		return 1
37	else
38		echo There is no "$1"
39	fi
40	return 0
41}
42
43##
44## Main script starts here
45##
46
47
48# Launch Installer
49
50cd /boot/home
51if [ -x /boot/system/apps/Installer ]; then
52	/boot/system/apps/Installer
53else
54	/boot/system/apps/Terminal
55fi
56
57# sync disks
58/bin/sync
59
60# prepare for reboot
61# (reboot quickly in 10 seconds)
62# (we must start the shutdown process before /boot is ejected)
63/bin/shutdown -r -q -d 10 &
64
65# unblock the CD tray
66/bin/eject -u /boot
67# and open it before rebooting
68/bin/eject /boot
69
70
71