forked from zhaojh329/rttys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jianhui Zhao <[email protected]>
- Loading branch information
Jianhui Zhao
committed
Oct 20, 2018
1 parent
bbb1812
commit 41f8e21
Showing
4 changed files
with
54 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#! /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 rttys 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/local/bin/rttys -- -port $PORT -cert /etc/rttys/rttys.crt -key /etc/rttys/rttys.key | ||
} | ||
|
||
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 | ||
|