-
Notifications
You must be signed in to change notification settings - Fork 0
/
startcontainer.sh
executable file
·44 lines (35 loc) · 1.25 KB
/
startcontainer.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
#!/bin/bash
function usage
{
echo "Usage: startcontainer.sh IMAGE_ID [dest url] [file to stream] [show logs]"
echo "Example: startcontainer.sh ABCDE rtmp://log:[email protected]:1935/live/streamname auto720p30@2M 0"
echo "Special filenames are: auto240p30@500k, auto720p30@2M, auto720p60@3M, auto1080p30@3M, and auto1080p60@4M"
exit 1
}
if [ "$#" -lt 1 ]; then
echo "Illegal number of parameters"
usage
fi
if [ -z "$2" ]; then
read -p "Enter destination URL with stream name (like rtmp://log:[email protected]:1935/live/streamname): " DEST_URL
else
DEST_URL=$2
fi
if [ -z "$3" ]; then
read -p "Enter file name to use (auto720p30@2M): " FILE_TO_STREAM
FILE_TO_STREAM=${FILE_TO_STREAM:-auto720p30@2M}
else
FILE_TO_STREAM=$3
fi
if [ -z "$4" ]; then
SHOW_LOGS=0
else
SHOW_LOGS=$4
fi
#vars *****
#DEST_URL
#FILE_TO_STREAM (opt) This file shoud be inside the container dir /data/test_material/
#SHOW_LOGS (opt) (0/1)
echo "Starting to publish to: ${DEST_URL}, File: ${FILE_TO_STREAM}, Show logs: ${SHOW_LOGS}"
#With --rm all modification to the container files are deleted when exit
docker run --name="loadtest_container_$i" -t --rm -e "FILE_TO_STREAM=${FILE_TO_STREAM}" -e "DEST_URL=${DEST_URL}" -e "SHOW_LOGS=${SHOW_LOGS}" $1 &