#!/bin/sh
EXECDIR=/usr/local/bin/airproxy050/
JAVA=/usr/bin/java
USER=airproxy
NAME=airproxy
DESC="airproxy server"
case "$1" in
start)
echo -n "Starting $DESC: "
if start-stop-daemon --stop --quiet \
--signal 0 --user $USER --exec $JAVA
then
echo "already running."
exit 1
fi
start-stop-daemon --chuid $USER --start --quiet --chdir $EXECDIR \
--user $USER --exec $JAVA -- -Djava.library.path=/usr/local/lib \
-jar airproxy.jar >& /var/log/airproxy/err.log &
echo "$NAME."
;;
stop)
echo -n "Stoping $DESC: "
if start-stop-daemon --stop --quiet \
--signal 0 --user $USER --exec $JAVA
then
start-stop-daemon --stop --quiet \
--signal 15 --user $USER --exec $JAVA
echo "$NAME."
else
echo "not running."
exit 1
fi
;;
*)
echo -n "Usage $NAME {start|stop}"
echo
exit 1
esac
exit 0
0 件のコメント:
コメントを投稿