-
-
Save hSATAC/87f7a598ed185b870141 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: uniqush-push | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts uniqush-push | |
# Description: Starts Uniqush provides a unified push service for server-side notification to apps on mobile devices. | |
### END INIT INFO | |
DAEMON="/usr/bin/uniqush-push" | |
CONF_FILE="/etc/uniqush/uniqush-push.conf" | |
PID=/run/uniqush-push.pid | |
NAME=uniqush-push | |
DESC=uniqush-push | |
SRV_UID=nobody | |
SRV_GID=nogroup | |
test -x $DAEMON || exit 0 | |
set -e | |
. /lib/lsb/init-functions | |
start() { | |
start-stop-daemon --start --quiet --pidfile $PID --chuid ${SRV_UID}:${SRV_GID} --user $SRV_UID --group $SRV_GID \ | |
--retry 5 --exec $DAEMON --oknodo --make-pidfile --background -- -config="$CONF_FILE" | |
} | |
stop() { | |
start-stop-daemon --stop --quiet --pidfile $PID \ | |
--retry 5 --oknodo --exec $DAEMON | |
} | |
case "$1" in | |
start) | |
log_daemon_msg "Starting $DESC" "$NAME" | |
start | |
log_end_msg $? | |
;; | |
stop) | |
log_daemon_msg "Stopping $DESC" "$NAME" | |
stop | |
log_end_msg $? | |
;; | |
restart) | |
log_daemon_msg "Restarting $DESC" "$NAME" | |
stop | |
sleep 1 | |
start | |
log_end_msg $? | |
;; | |
status) | |
status_of_proc -p $PID "$DAEMON" "$NAME" | |
;; | |
*) | |
echo "Usage: $NAME {start|stop|restart|status}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment