mirror of
https://github.com/zhaojh329/rttys.git
synced 2026-02-27 09:53:21 +08:00
48 lines
809 B
Bash
Executable File
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
|