All pastes #171473 Raw Edit

Mine

public text v1 · immutable
·published 2006-09-15 12:59 UTC
rendered paste body
#! /bin/bash

PYAES="/home/gbox/bin/do-irc-aes.sh"
RUN_AS=gbox
PIDFILE="/tmp/pyaes.pid"

# Check for missing binaries (stale symlinks should not happen)
test -x $PYAES || exit 5

case "$1" in
    start)
        echo -n "Starting py-aes "
        start-stop-daemon --start --background --quiet \
                --chuid $RUN_AS --background \
                --make-pidfile --pidfile "$PIDFILE" \
                --exec $PYAES
        echo "Done"
        ;;

    stop)
        echo -n "Stopping pyaes "
        start-stop-daemon --stop --quiet --pidfile "$PIDFILE"
        kill `ps axuww |grep "python ./irc-aes.py" |awk '{print $2}'`
        echo "Done"
        ;;

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