]> git.pld-linux.org Git - packages/console-tools.git/blob - console.init
- use run_cmd to catch fail case
[packages/console-tools.git] / console.init
1 #!/bin/sh
2 #
3 # console       Load console font and keyboard table
4 #
5 # chkconfig:    345 70 30
6 #
7 # description:  Loads the console font, the application-charset map \
8 #               and the keyboard table.
9
10 # This must be executed *after* /usr is mounted.
11 # This means is /usr is NFS-mounted, it needs to
12 # run after networking and NFS mounts are up.
13
14 [ -f /etc/sysconfig/console ] || exit 0
15
16 [ -f /usr/bin/consolechars ] || exit 0
17 [ -f /usr/bin/loadkeys ] || exit 0
18
19 # Source function library
20 . /etc/rc.d/init.d/functions
21
22 case "$1" in
23         start|restart)
24                 . /etc/sysconfig/console
25
26                 if [ -n "$SVGATEXTMODE" ]
27                 then
28                         run_cmd "Setting Text Mode $SVGATEXTMODE" SVGATextMode $SVGATEXTMODE
29                 fi
30                 if [ -n "$CONSOLEFONT" ]
31                 then
32                         run_cmd "Loading console font and map" consolechars -m ${CONSOLEMAP:-trivial.trans} -f $CONSOLEFONT
33                         # Don't use "" here because additional options may be
34                         # specified after the font name (e.g. fallback tables)
35                 fi
36                 if [ -n "$KEYTABLE" ]
37                 then
38                         run_cmd "Loading keyboard table" loadkeys $KEYTABLE < /dev/tty0 > /dev/tty0
39                 fi
40                 ;;
41         stop)
42                 # Nothing to stop
43                 ;;
44         status)
45                 # Nothing to report
46                 ;;
47         *)
48                 msg_usage "$0 {start|stop|status|restart}"
49                 exit 1
50 esac
51
52 exit 0
This page took 0.077192 seconds and 3 git commands to generate.