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