]> git.pld-linux.org Git - packages/gpm.git/blame - gpm.init
fix build with gcc 10
[packages/gpm.git] / gpm.init
CommitLineData
2c2a4a1e 1#!/bin/sh
9875fd88 2#
5cb8378b 3# chkconfig: 2345 85 15
4#
5# description: GPM adds mouse support to text-based Linux applications such \
6# the Midnight Commander. Is also allows mouse-based console \
7# cut-and-paste operations, and includes support for pop-up \
8# menus on the console.
21a47740
ER
9# description(es.UTF-8): GPM añade soporte al ratón para aplicaciones Linux \
10# consola como el Midnight Commander. También permite \
11# operaciones con el ratón de cortar y pegar e incluye soporte \
12# para menús pop-up en la consola.
13# description(pt_BR.UTF-8): O GPM adiciona suporte a mouse para aplicações Linux \
14# console como o Midnight Commander. Também permite \
15# operações com o mouse de cortar-e-colar e inclui suporte \
de9e9241 16# a menus pop-up no console.
5cb8378b 17#
18# processname: gpm
0a3f9e75 19# pidfile: /var/run/gpm.pid
5cb8378b 20# config: /etc/sysconfig/mouse
9875fd88 21
5cb8378b 22# Source function library
9875fd88 23. /etc/rc.d/init.d/functions
24
5cb8378b 25# Get service config
8a30c072 26[ -f /etc/sysconfig/mouse ] && . /etc/sysconfig/mouse
9875fd88 27
837b0320 28start() {
5cb8378b 29 # Check if the service is already running?
ef11a23a 30 if [ -f /var/lock/subsys/gpm ]; then
99d08cba 31 msg_already_running "Gpm"
ef11a23a
ER
32 return
33 fi
34
ef11a23a
ER
35 msg_starting "Gpm"
36 OPTIONS=""
37 [ -n "$DEVICE" ] && OPTIONS="-m $DEVICE"
38 [ -n "$MOUSETYPE" ] && OPTIONS="$OPTIONS -t $MOUSETYPE"
39 [ -n "$BAUD_RATE" ] && OPTIONS="$OPTIONS -b $BAUD_RATE"
40 [ -n "$CLEAR_LINES" ] && OPTIONS="$OPTIONS -o $CLEAR_LINES"
41 [ -n "$BUTTON_SEQ" ] && OPTIONS="$OPTIONS -B $BUTTON_SEQ"
42 [ -n "$TAP_BUTTON" ] && OPTIONS="$OPTIONS -g $TAP_BUTTON"
43 [ -n "$ACCEL" ] && OPTIONS="$OPTIONS -a $ACCEL"
44 [ -n "$DELTA" ] && OPTIONS="$OPTIONS -d $DELTA"
45 [ -n "$INTERVAL" ] && OPTIONS="$OPTIONS -i $INTERVAL"
46 [ -n "$RESP" ] && OPTIONS="$OPTIONS -r $RESP"
47 [ -n "$SAMPLE_RATE" ] && OPTIONS="$OPTIONS -s $SAMPLE_RATE"
48 [ -n "$CHARSET" ] && OPTIONS="$OPTIONS -l \"$CHARSET\""
49 [ "$BUTTON_COUNT" = "2" ] && OPTIONS="$OPTIONS -2"
50 [ "$BUTTON_COUNT" = "3" ] && OPTIONS="$OPTIONS -3"
51 if [ -n "$POINTER_VIS" ] && [ "$POINTER_VIS" != "no" ]; then
52 OPTIONS="$OPTIONS -p"
9875fd88 53 fi
ef11a23a
ER
54 if [ -n "$REPEATER" ] && [ "$REPEATER" != "no" ]; then
55 OPTIONS="$OPTIONS -R"
56 fi
57 daemon /usr/sbin/gpm $OPTIONS $GPM_OPTIONS < /dev/null
58 RETVAL=$?
59 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpm
837b0320
ER
60}
61
62stop() {
ef11a23a 63 if [ ! -f /var/lock/subsys/gpm ]; then
99d08cba 64 msg_not_running "Gpm"
ef11a23a 65 return
a24cc1e3 66 fi
ef11a23a
ER
67
68 msg_stopping "Gpm"
69 killproc gpm
70 rm -f /var/lock/subsys/gpm >/dev/null 2>&1
837b0320
ER
71}
72
72a87df0 73condrestart() {
ef11a23a 74 if [ ! -f /var/lock/subsys/gpm ]; then
72a87df0
JB
75 msg_not_running "Gpm"
76 RETVAL=$1
ef11a23a 77 return
72a87df0 78 fi
ef11a23a
ER
79
80 stop
81 start
72a87df0
JB
82}
83
837b0320
ER
84RETVAL=0
85# See how we were called.
86case "$1" in
87 start)
88 start
89 ;;
90 stop)
91 stop
9875fd88 92 ;;
72a87df0 93 restart)
837b0320
ER
94 stop
95 start
9875fd88 96 ;;
72a87df0
JB
97 try-restart)
98 condrestart 0
99 ;;
100 force-reload)
101 condrestart 7
102 ;;
9875fd88 103 status)
104 status gpm
a1e947af 105 exit $?
9875fd88 106 ;;
107 *)
72a87df0 108 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
a1e947af 109 exit 3
9875fd88 110esac
111
391cfcd5 112exit $RETVAL
This page took 0.051994 seconds and 4 git commands to generate.