Re: [Forum] Numlock status i XFree86?

From: Bruno Thomsen <bruno.thomsen@get2net.dk>
Date: Sat Aug 04 2001 - 10:38:57 CEST

Henrik Brix Andersen wrote:
>
> On 03 Aug 2001 19:07:34 +0200, Bruno Thomsen wrote:
> > Morten Liebach wrote:
> > Du skifter til root, og skriver i kommando linien: ntsysv
> >
> > så kommer du ind i en menu, der vælger du at den starter: numlock at
> > startup
>
> Hvilken distro kører du?
> Jeg kører selv Red Hat 7.1, og får bare en menu over hvilke scripts der
> ligger i /etc/init.d/ (Det samme som er tilgængeligt fra "# setup")
> Kan du ikke sende mig det script, der hedder "numlock"?
> Det bør ligge i /etc/init.d eller lignende.
>
> På forhånd tak
> //Brix
> --
> Henrik Brix Andersen <btech1@users.sourceforge.net>
>
> "MS Windows has users - GNU/Linux has a community"
>
> --
> AaLUG Forum liste - Forum@aalug.dk
> http://www.aalug.dk/mailman/listinfo/forum

Hej igen

Jeg kører linux mandrake 8.0
numlock filen lå i /etc/init.d (den skulle være attached til denne mail)

Bruno.

#!/bin/sh
#
# Startup script for NumLock
#
# description: Locks NumLock key at init runlevel change
# chkconfig: 345 85 15

# Source function library.
. /etc/rc.d/init.d/functions

# The following file make bash to relock the numlock key when logging
# since login unlock it.
SYSCONF_FILE=/var/lock/subsys/numlock
#SYSCONF_FILE=/etc/sysconfig/numlock

# See how we were called.
case "$1" in
  start)
        echo -n "Starting numlock: "
        echo_success
        echo
        touch $SYSCONF_FILE
        
        for tty in /dev/tty[1-8]; do
                setleds -D +num < $tty
        done

        ;;
  stop)
        echo -n "Disabling numlocks on ttys: "
        for tty in /dev/tty[1-8]; do
                setleds -D -num < $tty
        done
        echo_success
        echo
        rm -f $SYSCONF_FILE
        ;;
  status)
# status NumLock
# echo "dead status as reported is normal since NumLock doesn't need to daemonize"
        if [ -f $SYSCONF_FILE ]
        then
                echo "numlock is enabled"
        else
                echo "numlock is disabled"
        fi
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  reload)
        echo -n "Reloading numlock: "
        $0 start
        echo
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|reload|status}"
        exit 1
esac

exit 0
Received on Sat Aug 04 10:39:45 2001

This archive was generated by hypermail 2.1.8 : Tue Jul 19 2005 - 16:02:28 CEST