Last active
December 10, 2015 16:08
-
-
Save johndel/4459006 to your computer and use it in GitHub Desktop.
Start, restart and stop crtmpdserver :) My Edition! I love it.
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/bash | |
case $1 in | |
start) | |
echo "Starting crtmpd..."; | |
cd /root/crtmp/;exec ./crtmpserver ./configs/mine.lua & | |
echo "crtmpd started."; | |
sleep 2; | |
echo $(lsof -t -i :1935) > /var/run/crtmpd.pid; | |
echo $(lsof -t -i :1935); | |
;; | |
stop) | |
echo "Stopping crtmpd..."; | |
kill `lsof -t -i :1935`; | |
kill `cat /var/run/crtmpd.pid`; | |
echo "crtmpd stopped"; | |
;; | |
restart) | |
echo "Restarting crtmpd..."; | |
kill `lsof -t -i :1935`; | |
kill `cat /var/run/crtmpd.pid`; | |
cd /root/crtmp/;exec ./crtmpserver ./configs/mine.lua & | |
echo "crtmpd restarted."; | |
sleep 2; | |
echo $(lsof -t -i :1935) > /var/run/crtmpd.pid; | |
echo $(lsof -t -i :1935); | |
;; | |
*) | |
echo "usage: crtmpd {start|restart|stop}" ;; | |
esac | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment