-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathstart.sh
53 lines (47 loc) · 875 Bytes
/
start.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
52
53
#!/bin/bash
# defaults
RTMPSECRET="stream"
ADMINPASSWORD="password1"
for i in "$@"
do
case $i in
--secret=*)
RTMPSECRET="${i#*=}"
;;
--streams=*)
STREAMS="${i#*=}"
;;
*)
;;
esac
done
STREAMS="push ${STREAMS//;/;\npush }"
echo "rtmp {
server {
listen 1935;
chunk_size 4000;
application $RTMPSECRET {
live on;
$STREAMS;
}
}
}
events {}
http {
server {
listen 8080;
location / {
gzip off;
fastcgi_pass unix:/var/run/fcgiwrap.sock;
fastcgi_intercept_errors on;
include /usr/local/nginx/conf/fastcgi_params;
}
}
}" > /usr/local/nginx/conf/nginx.conf
if [ -S /var/run/fcgiwrap.sock ]; then
/usr/local/nginx/sbin/nginx -s reload
else
spawn-fcgi -s /var/run/fcgiwrap.sock /usr/sbin/fcgiwrap
/usr/local/nginx/sbin/nginx -g 'daemon off;'
fi
exit 0