Base: LCDproc 0.5.2
[lcdproc-de200c.git] / scripts / init-lcdproc.rpm.in
blob11a35e49d38ba89acc7c9cd15a1aa574e303247e
1 #!/bin/sh
2 # This is the lcdproc init-script for RPM based (RedHat, Mandrake) systems
4 # Copyright (C) 2001 Rene Wagner <reenoo@gmx.de>
5 # 2001 Guillaume Filion <gfk@logidac.com>
7 # This script is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # any later version.
12 # This script is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this file; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
22 # chkconfig: 345 71 20
23 # description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \
24 # Apart from the main client lcdproc(1) there are various clients. \
25 # See http://lcdproc.omnipotent.net for details.
26 # processname: lcdproc
27 # pidfile: /var/run/lcdproc.pid
28 # config: /etc/sysconfig/lcdproc
30 # Source function library.
31 . /etc/rc.d/init.d/functions
33 # Source networking configuration.
34 . /etc/sysconfig/network
36 # Check that networking is up.
37 if [ ${NETWORKING} = "no" ]; then
38 exit 0
41 RETVAL=0
43 prefix=@prefix@
44 exec_prefix=@exec_prefix@
45 bindir=@bindir@
46 sbindir=@sbindir@
47 etc=@sysconfdir@
49 lcdproc=${bindir}/lcdproc
51 [ -x ${lcdproc} ] || exit 0
54 start() {
55 echo -n "Starting up lcdproc: "
56 daemon ${lcdproc} $SCREENS
58 RETVAL=$?
59 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lcdproc
60 echo
63 stop() {
64 echo -n "Shutting down lcdproc: "
65 killproc lcdproc
66 RETVAL=$?
67 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lcdproc
68 echo
71 dostatus() {
72 status lcdproc
73 RETVAL=$?
76 restart() {
77 stop
78 start
79 RETVAL=$?
82 condrestart() {
83 [ -e /var/lock/subsys/lcdproc ] && restart || :
86 # See how we were called.
87 case "$1" in
88 start)
89 start
91 stop)
92 stop
94 status)
95 dostatus
97 restart)
98 restart
100 condrestart)
101 condrestart
104 echo "Usage: $0 {start|stop|status|restart|condrestart}"
105 exit 1
106 esac
108 exit $RETVAL