mirror of
https://github.com/zhaojh329/rtty.git
synced 2026-02-27 09:53:17 +08:00
c24912cf01
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
48 lines
819 B
Bash
Executable File
48 lines
819 B
Bash
Executable File
#! /bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: rtty
|
|
# Required-Start: $remote_fs $syslog
|
|
# Required-Stop: $remote_fs $syslog
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Execute the xterminal_broker command.
|
|
# Description:
|
|
### END INIT INFO
|
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
RTTYPID=/var/run/rtty.pid
|
|
PORT=5912
|
|
|
|
do_start () {
|
|
start-stop-daemon --start --make-pidfile --pidfile $RTTYPID --background --exec /usr/sbin/rtty.py -- -p $PORT -d /var/www/rtty
|
|
}
|
|
|
|
do_stop () {
|
|
start-stop-daemon --stop --pidfile $RTTYPID
|
|
sleep 1
|
|
rm -f $RTTYPID
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
do_start
|
|
;;
|
|
stop)
|
|
do_stop
|
|
;;
|
|
restart|reload|force-reload)
|
|
echo "Error: argument '$1' not supported" >&2
|
|
exit 3
|
|
;;
|
|
status)
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Usage: $0 start|stop" >&2
|
|
exit 3
|
|
;;
|
|
esac
|