A revised startup item for mac os

#!/bin/sh
#
# POPfile - startup script
#
# For this to work POPfile should be in /Library/POPfile
#
. /etc/rc.common
 
PFPATH='/Users//yourusername/Library/POPfile'
PIDFILE=$PFPATH/popfile.pid
DESC='POPfile mail classification proxy'
 
if [ "$1" == "start" ]; then
    ConsoleMessage "Starting $DESC"
    NOSTART=0
    if [ -e $PIDFILE ]; then
        if kill -0 `cat $PIDFILE` >/dev/null 2>&1; then
            ConsoleMessage "POPFile already running."
            NOSTART=1
        fi
    fi
    if [ "$NOSTART" = "0" ]; 
    then
        cd "$PFPATH"
        perl popfile.pl > /dev/null 2>&1 &
    fi
elif [ "$1" == "stop" ]; then
    ConsoleMessage "Stopping $DESC"
    if [ -e $PIDFILE ]; then
        kill -6 `cat $PIDFILE`
    else
        ConsoleMessage "$DESC not running."
    fi
fi
 
howtos/revisedstartupitem.txt · Last modified: 2008/03/12 10:16 by 127.0.0.1

Should you find anything in the documentation that is incomplete, unclear, outdated or just plain wrong, please let us know and leave a note in the Documentation Forum.

Recent changes RSS feed Donate Driven by DokuWiki
The content of this wiki is protected by the GNU Fee Documentation License