Fix typo in the Gentoo initscript.
[fbsplash.git] / gentoo / init-fbcondecor
blobce921b6e10e4117f5a2812643d109bffc8c2fc95
1 #!/sbin/runscript
2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
5 depend() {
6         before xdm
7         use localmount
10 start() {
11         . /sbin/splash-functions.sh
12         splash_setup
14         if [ -z "${FBCONDECOR_TTYS}" ]; then
15                 FBCONDECOR_TTYS=$(seq 1 "${rc_tty_number:-${RC_TTY_NUMBER:-12}}")
16         fi
18         local err=0
20         # Only do this if the kernel supports fbcondecor.
21         if fbcondecor_supported && [ "${SPLASH_MODE_REQ}" != "off" ]; then
22                 ebegin "Setting framebuffer console images"
24                 for TTY in ${FBCONDECOR_TTYS} ; do
25                         theme="${SPLASH_THEME}"
27                         [ ${TTY} = "1" -a -z "$(/usr/sbin/fbcondecor_ctl -c getstate --tty=${TTY}| grep 'off')" ] && continue
28                         [ ${TTY} = "0" ] && continue
30                         if [ -n "${FBCONDECOR_TTY_MAP}" ]; then
31                                 for i in ${FBCONDECOR_TTY_MAP//,/ } ; do
32                                         if [ "${i%:*}" = "${TTY}" ]; then
33                                                 theme="${i#*:}"
34                                         fi
35                                 done
36                         fi
38                         if [ -x /usr/bin/openvt ]; then
39                                 /usr/bin/openvt -c "${TTY}" -- printf "" 2>/dev/null
40                         fi
42                         if ! fbcondecor_set_theme "${theme}" "${TTY}"; then
43                                 err=1
44                                 eerror "Failed to set background image on tty${TTY}"
45                                 if [ -z "${FBCONDECOR_TTY_MAP}" ]; then
46                                         break
47                                 fi
48                         fi
49                 done
50                 eend "${err}"
51         fi