Lcdproc Startscript zur Nutzung des LCDd unter openSUSE

Aus Linupedia.org
Wechseln zu: Navigation, Suche

Hier nun passend zum LCDd Startscript das ebenso modifizierte Startscript für SUSE/openSUSE Linux zur Anzeige der diversen Systeminformationen, also für lcdproc selbst als Client für den LCDd.


#!/bin/sh
# This is the lcdproc init-script for RPM based (RedHat, Mandrake) systems
#
# Copyright (C) 2001  Rene Wagner <reenoo@gmx.de>
#               2001  Guillaume Filion <gfk@logidac.com>
#
# Modified for openSUSE 2006 by Tom Meierjürgen <tomcatmj@web.de|
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307

### BEGIN INIT INFO
# Provides:          lcdproc
# Required-Start:    $local_fs $syslog $network $LCD-lcdproc
# X-UnitedLinux-Should-Start: inetd sensors 
# Required-Stop:     $local_fs $syslog
# X-UnitedLinux-Should-Stop: inetd sensors 
# Default-Start:     2 3 5
# Default-Stop:      0 1 6
# Short-Description: LCDd lcdproc server daemon
# Description:       start LCDd lcdproc server daemon which displays system informations on a LCD
### END INIT INFO

#
#
# chkconfig: 345 71 20
# description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \
#       Apart from the main client lcdproc(1) there are various clients. \
#       See http://lcdproc.omnipotent.net for details.
# processname: lcdproc
# pidfile: /var/run/lcdproc.pid
# config: /etc/sysconfig/lcdproc

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

# Source networking configuration.
#. /etc/sysconfig/network

# Check that networking is up.
#if [ ${NETWORKING} = "no" ]; then
#        exit 0
#fi

RETVAL=0

prefix=/usr/local
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
sbindir=${exec_prefix}/sbin
etc=${prefix}/etc
lcdprocbin=${bindir}/lcdproc
lcdprocconf=${etc}/lcdproc.conf
SCREENS="C X";
# Check for missing binaries (stale symlinks should not happen)
test -x $lcdprocbin || { echo "$lcdprocbin not installed"; exit 5; }

# Check for existence of needed config file

test -r $lcdprocconf || { echo "$lcdprocconf not existing"; exit 6; }

# Source LSB init functions
. /etc/rc.status


# See how we were called.
case "$1" in
    start)
        echo -n "Starting lcdproc "

        if [ -f $lcdprocconf ]; then
                startproc ${lcdprocbin} -c ${lcdprocconf}
        else
                startproc ${lcdprocbin} -d $SCREENS
        fi

        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/lcdproc
        echo
        rc_status -v
        ;;
    stop)
        echo -n "Shutting down lcd4linux "
        killproc -TERM $lcdprocbin
        rc_status -v
        ;;
    try-restart|condrestart)
        if test "$1" = "condrestart"; then
                echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
        fi
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        rc_status
        ;;
  status)
        echo -n "Checking for service lcdproc "
        checkproc $lcdprocbin
        rc_status -v
        ;;

  restart)
        $0 stop
        $0 start
        rc_status
        ;;
  force-reload)
        echo -n "Reload service lcdproc "
        killproc -HUP $lcdprocbin
        rc_status -v
        ;;
  reload)
        echo -n "Reload service lcdproc "
        killproc -HUP $lcdprocbin
        rc_status -v
        ;;

  *)
        echo "Usage: $0 {start|stop|status|restart|condrestart}"
        exit 1
esac

exit $RETVAL

Ursprungsautor der modifizierten lcdproc SUSE Startscript-Version: TomcatMJ 13:21, 29. Dez 2006 (CET)


Zurück zu den Shellscripten
Zurück zur USB-Übersicht