beznogno / pyicqt

Automatically exported from code.google.com/p/pyicqt
GNU General Public License v2.0
0 stars 0 forks source link

debian init-script #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
 Posted by guest at 2006-10-31 10:22:37

Hi there,

I've created this init-script for my debian server. Maybe it helps.. :)

----

#! /bin/sh
#
# pyicqt        Start/stop icq/jabber gateway
#
# created by P. Giebel (arch -AT- ambience-design -DOT- net)
# creation date: 02-10-2006
# last updated: 02-10-2006
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin
PYICQTPATH=/usr/local/pyicqt
PYICQT=PyICQt.py
PIDFILE=/usr/local/var/run/PyICQt.pid
LOGFILE=/usr/local/var/log/pyicqt.log
ERRORLOG=/usr/local/var/log/pyicqt-error.log
PYICQTUSER=ejabberd
NAME=pyicqt

test -f $PYICQTPATH/$PYICQT || exit 0

start()
{
    su $PYICQTUSER -c "cd $PYICQTPATH ; ./$PYICQT > $LOGFILE 2>
$ERRORLOG &"
}

case "$1" in
    start)
        echo -n "Starting jabber/icq transport: $NAME"
        if test -f $PIDFILE ; then
            echo -n " already running"
        else
            start
            echo -n .
        fi
    ;;
    stop)
        echo -n "Stopping jabber/icq transport: $NAME"
        if test -f $PIDFILE ; then
            if /bin/kill `cat $PIDFILE` ; then
                echo -n .
            else
                echo -n " failed"
            fi
        else
            echo -n " already stopped"
        fi
    ;;

    restart|force-reload)
        echo -n "Restarting jabber/icq transport: $NAME"
        if test -f $PIDFILE ; then
            if /bin/kill `cat $PIDFILE` ; then
                sleep 5
                start
                echo -n .
            else
                echo -n "failed"
            fi
        else
            echo -n " is not running. Starting $NAME"
            start
            echo -n .
        fi
    ;;
    *)
        echo "Usage: /etc/init.d/$NAME
{start|stop|restart|force-reload}" >&2
        exit 1
    ;;
esac

if [ $? -eq 0 ]; then
    echo .
else
    echo " failed."
fi

exit 0

----

regards,
  stimpy

Posted by Z_God at 2006-11-02 22:49:17

I've also stil got Fawzib's scripts here if you're interested.

Original issue reported on code.google.com by jadest...@gmail.com on 15 Dec 2007 at 5:29

GoogleCodeExporter commented 9 years ago
PyICQt in Debian have init script, seems all right :)

Original comment by r000ns...@gmail.com on 12 Dec 2008 at 11:11