forked from manishkatyan/bbb-streaming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-streaming.sh
executable file
·51 lines (43 loc) · 1.37 KB
/
start-streaming.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
test ! -f ./env && echo "Unable to find the env file" && echo "No such file $(pwd)/env" && exit 0
set -a
source <(cat ./env | \
sed -e '/^#/d;/^\s*$/d' -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
set +a
if [ -z $BBB_URL ]; then
echo "Error: BBB_URL cannot be empty"
exit 0
fi
if [ -z $BBB_SECRET ]; then
echo "Error: BBB_SECRET cannot be empty"
exit 0
fi
if [ -z $MEETINGID ]; then
echo "Error: MEETINGID cannot be empty"
exit 0
fi
if [ -z $MEETING_PASSWORD ]; then
echo "Error: MEETING_PASSWORD cannot be empty"
exit 0
fi
if [ -z $RTMP_URL ]; then
echo "Error: RTMP_URL cannot be empty"
exit 0
fi
if [ -z $SHOW_PRESENTATION ]; then
echo "Error: SHOW_PRESENTATION cannot be empty"
exit 0
fi
docker run --rm -d \
--name bbb-streaming \
-p "4040:4000" \
manishkatyan/bbb-streaming:v2.0.1
until [ "`docker inspect -f {{.State.Running}} bbb-streaming`" == "true" ]; do
echo "waiting for the bbb-streaming... "
sleep 2;
done;
sleep 5
echo "Starting streaming..."
curl -X POST -H 'Content-Type: application/json' \
-d "{\"bbbUrl\":\"$BBB_URL\",\"bbbSecret\":\"$BBB_SECRET\",\"meetingId\": $MEETINGID,\"meetingPassword\": $MEETING_PASSWORD,\"rtmpUrl\": $RTMP_URL,\"showPresentation\": $SHOW_PRESENTATION,\"isThirdParty\": true }" \
http://localhost:4040/bot/start