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

Annotation of /numlock/branches/1/numlock.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 415 - (hide annotations) (download)
Thu Feb 3 22:38:52 2011 UTC (13 years, 2 months ago) by dmorgan
Original Path: numlock/trunk/numlock.init
File size: 1285 byte(s)
Import cleaned numlock
1 dmorgan 415 #!/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.30