/[baselayout]/trunk/init.d.Linux/numlock
Gentoo

Contents of /trunk/init.d.Linux/numlock

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2763 - (show annotations) (download)
Tue Jul 10 19:09:41 2007 UTC (7 years, 1 month ago) by uberlord
File size: 664 byte(s)
init scripts and their extra options can now have descriptions, #184327.
1 #!/sbin/runscript
2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 description="Turns numlock on for the consoles."
6
7 depend() {
8 need localmount
9 }
10
11 _setleds() {
12 [ -z "$1" ] && return 1
13
14 local dev=/dev/tty t= i=1 retval=0
15 [ -d /dev/vc ] && dev=/dev/vc/
16
17 while [ ${i} -le ${RC_TTY_NUMBER:-11} ] ; do
18 setleds -D "$1"num < ${dev}${i} || retval=1
19 i=$((${i} + 1))
20 done
21
22 return ${retval}
23 }
24
25 start() {
26 ebegin "Enabling numlock on ttys"
27 _setleds +
28 eend $? "Failed to enable numlock"
29 }
30
31 stop() {
32 ebegin "Disabling numlock on ttys"
33 _setleds -
34 eend $? "Failed to disable numlock"
35 }
36
37 # vim: set ts=4 :

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20