#!/bin/sh ### BEGIN INIT INFO # Provides: console-setup # Required-Start: $remote_fs # Required-Stop: # Should-Start: console-screen kbd # Default-Start: S # Default-Stop: # X-Interactive: true # Short-Description: Set console keymap ### END INIT INFO set -e # This script is used jointly by console-setup and console-setup-mini. # It belongs to keyboard-configuration because it is forbidden two # different packages to share common configuration file. test -f /usr/bin/loadkeys || exit 0 if test -f /etc/default/locale { # In order to permit auto-detection of the charmap when # console-setup-mini operates without configuration file. source /etc/default/locale export LANG } if test -f /lib/lsb/init-functions { source /lib/lsb/init-functions } else { proc log_action_begin_msg { echo -n "$ifsjoin(Argv)... " } proc log_action_end_msg { if test $1 -eq 0 { echo done. } else { echo failed. } } } matchstr $1 { stop|status { # console-setup isn't a daemon } start|force-reload|restart|reload { if loadkeys /etc/console-setup/cached.kmap.gz { log_action_end_msg 0 } else { log_action_end_msg $Status } } * { echo 'Usage: /etc/init.d/console-setup {start|reload|restart|force-reload|stop|status}' exit 1 } } exit 0 (CommandList children: [ (C {(set)} {(-e)}) (AndOr children:[(C {(test)} {(-f)} {(/usr/bin/loadkeys)})(C {(exit)} {(0)})] op_id:Op_DPipe) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(/etc/default/locale)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(.)} {(/etc/default/locale)}) (C {(export)} {(LANG)})] spids: [-1 73] ) ] spids: [-1 93] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(/lib/lsb/init-functions)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(.)} {(/lib/lsb/init-functions)})] spids: [-1 107] ) ] else_action: [ (FuncDef name: log_action_begin_msg body: (BraceGroup children: [(C {(echo)} {(-n)} {(DQ ($ VSub_At "$@") ("... "))})] spids: [122] ) spids: [117 121] ) (FuncDef name: log_action_end_msg body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Number "$1"))} {(-eq)} {(0)} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(echo)} {(done.)})] spids: [-1 162] ) ] else_action: [(C {(echo)} {(failed.)})] spids: [171 179] ) ] spids: [144] ) spids: [139 143] ) ] spids: [114 184] ) (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list:[{(stop)}{(status)}] spids:[196199206-1]) (case_arm pat_list: [{(start)} {(force-reload)} {(restart)} {(reload)}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(loadkeys)} {(/etc/console-setup/cached.kmap.gz)}) terminator: ) ] action: [(C {(log_action_end_msg)} {(0)})] spids: [-1 227] ) ] else_action: [(C {(log_action_end_msg)} {($ VSub_QMark "$?")})] spids: [235 243] ) ] spids: [209 216 246 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(echo)} { (SQ < "Usage: /etc/init.d/console-setup {start|reload|restart|force-reload|stop|status}" > ) } ) (C {(exit)} {(1)}) ] spids: [249 250 265 -1] ) ] spids: [187 193 267] ) (C {(exit)} {(0)}) ] )