summaryrefslogtreecommitdiffstats
path: root/rc/rc.multi
blob: d11f0004cae553837d76af07ca2b907baf056eef (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
45
46
47
48
#!/bin/bash
#
# /etc/rc.multi: multi-user startup script
#

# Load configuration
. /etc/rc.conf

# Run fixes startup file
if [ -x /etc/rc.fix ]; then
        /etc/rc.fix
fi

echo_err () {
	echo -n -e "\033[00;31m\033[66G!$1!\033[00m"
	echo -e "\033[76G\033[00;01;31m[X]\033[00m"
}
echo_ok () {
	echo -e "\033[76G\033[00;01;32m[V]\033[00m"
}


# Start services
if [ "$SYSLOG" -o "${SERVICES[*]}" ]; then
	echo -e "\033[00;01m   > Starting services:\033[00m"
	if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then
		echo -e -n "\033[00m $SYSLOG"
		/etc/rc.d/$SYSLOG start &> /dev/null || echo_err
	fi
	for service in ${SERVICES[@]}; do
		echo -e -n "\033[00m > $service"
		if /etc/rc.d/$service start &> /tmp/rc.$$; then
			echo_ok
		else
			echo_err $?
		fi
		/usr/bin/logger -t $service -f /tmp/rc.$$
		/bin/rm -f /tmp/rc.$$
	done
	echo
fi

# Run local startup script
if [ -x /etc/rc.local ]; then
	/etc/rc.local
fi

# End of file