소스 검색

launchall server

David 10 년 전
부모
커밋
ef66e601e7
1개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. 24 0
      server/launchall.sh

+ 24 - 0
server/launchall.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+
+function finish {
+	echo "Exiting"
+	echo '{"type": "snowmix", "command": "kill", "key": "video"}' | wscat
+	echo '{"type": "snowmix", "command": "kill", "key": "audio"}' | wscat
+	echo '{"type": "snowmix", "command": "kill", "key": "rtmp"}' | wscat
+}
+
+snowmix=$(ps axco command | grep -c snowmix)
+if [ $snowmix -ne 1 ]; then
+	echo "snowmix not running!"
+	exit 1
+fi
+
+trap finish EXIT
+
+echo "Running" 
+echo '{"type": "snowmix", "command": "launch", "key": "video"}' | wscat
+echo '{"type": "snowmix", "command": "launch", "key": "audio"}' | wscat
+echo '{"type": "snowmix", "command": "launch", "key": "rtmp"}' | wscat
+
+sleep infinity
+finish