Sha256: 1b3dd2a571cfc23385b10915519bd7aec135b6e3d6dd8c0568b7e04fb158e7c2

Contents?: true

Size: 1.38 KB

Versions: 16

Compression:

Stored size: 1.38 KB

Contents

#!/bin/bash
#
#       /etc/rc.d/init.d/apnserverd
# apnserverd    This shell script takes care of starting and stopping
#               the APN Server Proxy
#
# chkconfig: 345 20 80
# Author: Ben Poweski bpoweski@gmail.com
#
# Source function library.
. /etc/init.d/functions

NAME=apnserverd
APNSERVERD=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid

if [ -f /etc/sysconfig/$NAME ]; then
        . /etc/sysconfig/$NAME
fi


start() {
        echo -n "Starting APN Server:  "
        if [ -f $PIDFILE ]; then
                PID=`cat $PIDFILE`
                echo $NAME already running: $PID
                exit 2;
        elif [ -f $PIDFILE ]; then
                PID=`cat $PIDFILE`
                echo $NAME already running: $PID
                exit 2;
        else
                daemon $APNSERVERD $OPTIONS
                RETVAL=$?
		echo 
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
                return $RETVAL
        fi

}

stop() {
        echo -n "Shutting down APN Server: "
        echo
        kill `cat $PIDFILE`
        echo
        rm -f /var/lock/subsys/$NAME
		rm -f $PIDFILE
        return 0
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status $NAME
        ;;
    restart)
        stop
        start
        ;;
    *)
        echo "Usage:  {start|stop|status|restart}"
        exit 1
        ;;
esac
exit $?

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
bpoweski-apnserver-0.0.14 bin/apnserverd.fedora.init
bpoweski-apnserver-0.0.15 bin/apnserverd.fedora.init
bpoweski-apnserver-0.0.17 bin/apnserverd.fedora.init
bpoweski-apnserver-0.1.2 bin/apnserverd.fedora.init
bpoweski-apnserver-0.1.3 bin/apnserverd.fedora.init
bpoweski-apnserver-0.1.6 bin/apnserverd.fedora.init
bpoweski-apnserver-0.1.7 bin/apnserverd.fedora.init
apnserver-0.2.2 bin/apnserverd.fedora.init
racoon-0.6.0 bin/apnserverd.fedora.init
racoon-0.5.0 bin/apnserverd.fedora.init
racoon-0.4.0 bin/apnserverd.fedora.init
racoon-0.3.2 bin/apnserverd.fedora.init
racoon-0.3.1 bin/apnserverd.fedora.init
apnserver-0.2.1 bin/apnserverd.fedora.init
apnserver-0.1.10 bin/apnserverd.fedora.init
apnserver-0.1.9 bin/apnserverd.fedora.init