check_pid() { # check for PID file if [ -f $PID ]; then # PID file is there, is it readable? if [ -r $PID ]; then # it's readable, is there a process? if [ "$DAEMON $CMDLINE" = "`ps -p\`cat $PID\` -o cmd h`" ]; then # looks like it's already running echo "$NAME is already running." exit 0 else # looks like a stale PID file rm -f $PID fi else echo "$PID file already exists, but is not accessible." exit 1 fi fi } not_enabled() { echo echo "The jabber daemon is not enabled yet." echo "Set the ENABLED field in /etc/default/jabberd from 0 to 1." echo "Remamber to set the JABBER_HOSTNAME field in /etc/jabberd/jabber.cfg" echo "Finally, don't forget about jabber.xml and muc.xml (also in /etc/jabberd)" echo }