/[soft]/numlock/branches/1/numlock.init
ViewVC logotype

Contents of /numlock/branches/1/numlock.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1637 - (show annotations) (download)
Thu Jun 2 20:45:18 2011 UTC (10 years, 7 months ago) by dmorgan
File size: 1285 byte(s)
Branch for updates
1 #!/bin/sh
2 #
3 # Startup script for NumLock
4 #
5 # description: Locks NumLock key at init runlevel change
6 # chkconfig: 3457 29 15
7 #
8 ### BEGIN INIT INFO
9 # Provides: numlock
10 # Default-Start: 3 4 5 7
11 # Short-Description: Locks NumLock key at init runlevel change
12 # Description: Locks NumLock key at init runlevel change
13 ### END INIT INFO
14
15 # Source function library.
16 . /etc/rc.d/init.d/functions
17
18 # The following file make bash to relock the numlock key when logging
19 # since login unlock it.
20 SYSCONF_FILE=/var/lock/subsys/numlock
21 #SYSCONF_FILE=/etc/sysconfig/numlock
22
23 # See how we were called.
24 case "$1" in
25 start)
26 echo -n "Starting numlock: "
27 echo_success
28 echo
29 touch $SYSCONF_FILE
30
31 for tty in /dev/tty[1-8]; do
32 setleds -D +num < $tty
33 done
34
35 ;;
36 stop)
37 echo -n "Disabling numlocks on ttys: "
38 for tty in /dev/tty[1-8]; do
39 setleds -D -num < $tty
40 done
41 echo_success
42 echo
43 rm -f $SYSCONF_FILE
44 ;;
45 status)
46 # status NumLock
47 # echo "dead status as reported is normal since NumLock doesn't need to daemonize"
48 if [ -f $SYSCONF_FILE ]
49 then
50 echo "numlock is enabled"
51 else
52 echo "numlock is disabled"
53 fi
54 ;;
55 restart)
56 $0 stop
57 $0 start
58 ;;
59 reload)
60 echo -n "Reloading numlock: "
61 $0 start
62 echo
63 ;;
64 *)
65 echo "Usage: $0 {start|stop|restart|reload|status}"
66 exit 1
67 esac
68
69 exit 0

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.28