Files
archived-rttys/rttys.init
Jianhui Zhao 260977b924 improve and perfect document
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
2018-01-17 23:21:24 +08:00

48 lines
809 B
Bash
Executable File

#! /bin/sh
### BEGIN INIT INFO
# Provides: rttys
# 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
RTTYSPID=/var/run/rttys.pid
PORT=5912
do_start () {
start-stop-daemon --start --make-pidfile --pidfile $RTTYSPID --background --exec /usr/sbin/rttys -- -port $PORT
}
do_stop () {
start-stop-daemon --stop --pidfile $RTTYSPID
sleep 1
rm -f $RTTYSPID
}
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