/[packages]/cauldron/gpm/current/SOURCES/gpm.init
ViewVC logotype

Contents of /cauldron/gpm/current/SOURCES/gpm.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 664 - (show annotations) (download)
Sat Jan 8 14:51:55 2011 UTC (13 years, 3 months ago) by blino
File size: 1904 byte(s)
imported package gpm
1 #!/bin/bash
2 #
3 # chkconfig: 2345 15 15
4 # description: GPM adds mouse support to text-based Linux applications such \
5 # the Midnight Commander. Is also allows mouse-based console \
6 # cut-and-paste operations, and includes support for pop-up \
7 # menus on the console.
8 # processname: gpm
9 # pidfile: /var/run/gpm.pid
10 # config: /etc/sysconfig/mouse
11 #
12 ### BEGIN INIT INFO
13 # Provides: gpm
14 # Should-Start: harddrake
15 # Default-Start: 2 3 4 5
16 # Short-Description: Mouse support for text-based applications
17 # Description: GPM adds mouse support to text-based Linux applications such \
18 # the Midnight Commander. Is also allows mouse-based console \
19 # cut-and-paste operations, and includes support for pop-up \
20 # menus on the console.
21 ### END INIT INFO
22
23 # source function library
24 . /etc/rc.d/init.d/functions
25
26 MOUSECFG=/etc/sysconfig/mouse
27 MOUSEDEVICE=/dev/mouse
28
29 RETVAL=0
30
31 case "$1" in
32 start)
33 echo -n $"Starting console mouse services: "
34 if [ -f "$MOUSECFG" ]; then
35 . "$MOUSECFG"
36 else
37 echo $"(no mouse is configured)"
38 exit 0
39 fi
40
41 if [ -n "$device" ];then
42 MOUSEDEVICE=/dev/$device
43 fi
44
45 if [ ! -e $MOUSEDEVICE ];then
46 echo $"$MOUSEDEVICE don't exist"
47 exit 0
48 fi
49
50 if [ "$MOUSETYPE" = "none" ]; then
51 echo $"(no mouse is configured)"
52 exit 0
53 fi
54
55 if [ "$MOUSETYPE" = "Microsoft" ]; then
56 MOUSETYPE=ms
57 fi
58
59 if [ -n "$MOUSETYPE" ]; then
60 daemon gpm -m $MOUSEDEVICE -t $MOUSETYPE
61 else
62 daemon gpm -m $MOUSEDEVICE
63 fi
64 RETVAL=$?
65 echo
66 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpm
67 ;;
68 stop)
69 echo -n $"Shutting down console mouse services: "
70 killproc gpm
71 RETVAL=$?
72
73 echo
74 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gpm
75 ;;
76 restart|reload)
77 $0 stop
78 $0 start
79 RETVAL=$?
80 ;;
81 status)
82 status gpm
83 RETVAL=$?
84 ;;
85 *)
86 echo $"Usage: gpm {start|stop|status|restart|reload}"
87 exit 1
88 esac
89
90 exit $RETVAL
91

  ViewVC Help
Powered by ViewVC 1.1.30