1959126089
shuts down (#135776)
99 lines
1.7 KiB
Bash
Executable File
99 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# chkconfig: 2345 85 15
|
|
# description: GPM adds mouse support to text-based Linux applications such \
|
|
# as the Midnight Commander. It also allows mouse-based console \
|
|
# cut-and-paste operations, and includes support for pop-up \
|
|
# menus on the console.
|
|
# processname: gpm
|
|
# pidfile: /var/run/gpm.pid
|
|
# config: /etc/sysconfig/mouse
|
|
|
|
# source function library
|
|
. /etc/init.d/functions
|
|
|
|
if test -e /etc/sysconfig/mouse ; then
|
|
. /etc/sysconfig/mouse
|
|
fi
|
|
|
|
RETVAL=0
|
|
|
|
start() {
|
|
echo -n $"Starting console mouse services: "
|
|
|
|
if [ -z "$MOUSETYPE" ]; then
|
|
MOUSETYPE="exps2"
|
|
fi
|
|
|
|
if [ -z "$DEVICE" ]; then
|
|
DEVICE="/dev/input/mice"
|
|
fi
|
|
|
|
if [ "$MOUSETYPE" = "none" ]; then
|
|
echo $"(no mouse is configured)"
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$MOUSETYPE" = "Microsoft" ]; then
|
|
MOUSETYPE=ms
|
|
fi
|
|
|
|
if [ -n "$IMOUSETYPE" ]; then
|
|
if [ "$(pidofproc inputattach)" = "" ]; then
|
|
modprobe sermouse > /dev/null 2>&1
|
|
/usr/sbin/inputattach -$IMOUSETYPE $DEVICE --daemon
|
|
DEVICE="/dev/input/mice"
|
|
MOUSETYPE="exps2"
|
|
fi
|
|
fi
|
|
|
|
if [ -n "$MOUSETYPE" ]; then
|
|
daemon gpm -m $DEVICE -t $MOUSETYPE $OPTIONS
|
|
else
|
|
daemon gpm -m $DEVICE $OPTIONS
|
|
fi
|
|
RETVAL=$?
|
|
echo
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpm
|
|
}
|
|
|
|
stop() {
|
|
echo -n $"Shutting down console mouse services: "
|
|
killproc gpm
|
|
if [ -n "$IMOUSETYPE" ]; then
|
|
killproc inputattach
|
|
fi
|
|
RETVAL=$?
|
|
|
|
echo
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gpm
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
stop
|
|
start
|
|
;;
|
|
condrestart)
|
|
if [ -f /var/lock/subsys/gpm ]; then
|
|
stop
|
|
start
|
|
fi
|
|
;;
|
|
status)
|
|
status gpm
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $RETVAL
|