Last active
January 20, 2018 16:18
-
-
Save Qoraiche/84785fc5eefe6e0318129b660148a3ba to your computer and use it in GitHub Desktop.
red5-autostart-vultr-tutorial
This file contains hidden or 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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: red5 | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Red5 server | |
# Red5 version : 1.0.9 | |
### END INIT INFO | |
start() { | |
cd /opt/red5 && nohup ./red5.sh > /dev/null 2>&1 & | |
echo 'Service started' >&2 | |
} | |
stop() { | |
cd /opt/red5 && ./red5-shutdown.sh > /dev/null 2>&1 & | |
echo 'Service stopped' >&2 | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment