forked from Goldtrak/FOS-Streaming-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_panel.php
457 lines (437 loc) · 27.6 KB
/
install_panel.php
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
<?php
if (strtolower(substr(PHP_OS, 0, 5)) === 'linux')
{
$release_info = array();
$files = glob('/etc/*-release');
foreach ($files as $file)
{
$lines = array_filter(array_map(function($line) {
$parts = explode('=', $line);
if (count($parts) !== 2) return false;
$parts[1] = str_replace(array('"', "'"), '', $parts[1]);
return $parts;
}, file($file)));
foreach ($lines as $line)
$release_info[$line[0]] = $line[1];
}
#print_r($release_info);
}
$arch = shell_exec( "uname -m" );
echo "Welcome \n";
echo "FOS-Streaming will be installed on your system \n";
echo "Please don't close this session until it's finished \n \n";
echo "1. [Distribution Detection:] ";
echo " [############";
if (trim($release_info["DISTRIB_ID"]) == "Ubuntu") {
echo "]PASS \n";
}
elseif (trim($release_info["DISTRIB_ID"]) == "Debian") {
echo "]PASS \n";
}
else {
echo "]FAIL \n";
echo "///////////////////////////////////////////////////// \n";
echo " Report this problem on www.fos-streaming.com \n";
echo ' Distro: ' . $release_info["DISTRIB_ID"] . "\n ";
echo 'Version: ' . $release_info["DISTRIB_RELEASE"] . "\n ";
echo 'Codename: ' . $release_info["DISTRIB_CODENAME"] . "\n ";
echo 'Discription: ' . $release_info["DISTRIB_DESCRIPTION"] . "\n ";
echo $arch;
echo "///////////////////////////////////////////////////// \n";
die();
}
echo "2. [Arch Detection:] ";
echo " [############";
if(trim($arch) == "x86_64") {
echo "]PASS \n";
echo "3. [Installing needed files:]";
echo " [#";
shell_exec("apt-get install -y --force-yes libxml2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libbz2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libcurl4-openssl-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libmcrypt-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libmhash2 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libmhash-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpcre3 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpcre3-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes make > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes build-essential > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxslt1-dev git > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssl-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes git > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes php5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes unzip > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes python-software-properties > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpopt0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpq-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpq5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpspell-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libpthread-stubs0-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpython-stdlib > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libqdbm-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libqdbm14 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libquadmath0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librecode-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librecode0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librtmp-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librtmp0 > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libsasl2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsasl2-modules > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsctp-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsctp1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsensors4 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsensors4-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsm-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsm6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsnmp-base > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsnmp-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libsnmp-perl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsnmp30 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsqlite3-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssh2-1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssh2-1-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssl-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libstdc++-4.8-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libstdc++6-4.7-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libsybdb5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtasn1-3-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtasn1-6-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libterm-readkey-perl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtidy-0.99-0 > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libtidy-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtiff5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtiff5-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtiffxx5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtimedate-perl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtinfo-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtool > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtsan0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libunistring0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libvpx-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libvpx1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libwrap0-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libx11-6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libx11-data > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libx11-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxau-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxau6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxcb1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxcb1-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libxdmcp-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxdmcp6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxml2 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxml2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxmltok1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxmltok1-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxpm-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxpm4 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxslt1-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxslt1.1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxt-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxt6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes linux-libc-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes m4 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes make > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes man-db > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes netcat-openbsd > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes odbcinst1debian2 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes openssl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes patch > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes pkg-config > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes po-debconf > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python-minimal > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python2.7 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python2.7-minimal > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes re2c > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes unixodbc > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes unixodbc-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes uuid-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes x11-common > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes x11proto-core-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes x11proto-input-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes x11proto-kb-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes xorg-sgml-doctools > /dev/null 2>&1");
shell_exec("apt-get install -y libjpeg8 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes xtrans-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes zlib1g-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes php5-fpm > /dev/null 2>&1");
echo "]PASS \n";
echo "4. [FOS-Panel Installation:] ";
echo " [#";
$filename = '/usr/src/FOS-Streaming';
if (file_exists($filename)) {
shell_exec("/bin/rm -r /usr/src/FOS-Streaming > /dev/null 2>&1");
} else {
}
shell_exec("/usr/sbin/useradd -s /sbin/nologin -U -d /home/fos-streaming -m fosstreaming > /dev/null");
echo "##";
shell_exec("wget http://fos-streaming.com/fos-streaming_unpack_x84_64.tar.gz -O /home/fos-streaming/fos-streaming_unpack_x84_64.tar.gz > /dev/null 2>&1");
shell_exec("tar -xzf /home/fos-streaming/fos-streaming_unpack_x84_64.tar.gz -C /home/fos-streaming/ > /dev/null 2>&1");
shell_exec("/bin/rm -r /home/fos-streaming/fos-streaming_unpack_x84_64.tar.gz > /dev/null 2>&1");
shell_exec("/bin/mkdir /usr/src/FOS-Streaming > /dev/null 2>&1");
echo "##";
shell_exec("git clone https://github.com/zgelici/FOS-Streaming-v1.git /usr/src/FOS-Streaming/ > /dev/null 2>&1");
shell_exec("/bin/mv /usr/src/FOS-Streaming/* /home/fos-streaming/fos/www/ > /dev/null 2>&1");
shell_exec("wget https://getcomposer.org/installer -O /usr/src/installer > /dev/null 2>&1");
shell_exec("/usr/bin/php /usr/src/installer > /dev/null 2>&1");
shell_exec("/bin/cp /usr/src/composer.phar /usr/bin/composer.phar > /dev/null 2>&1");
shell_exec("/usr/bin/composer.phar install -d /home/fos-streaming/fos/www/ > /dev/null 2>&1");
echo "#";
shell_exec("echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffmpeg' >> /etc/sudoers");
shell_exec("echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffprobe' >> /etc/sudoers");
shell_exec("echo '*/2 * * * * www-data /usr/bin/php /home/fos-streaming/fos/www/cron.php' >> /etc/crontab");
echo "#";
shell_exec("sed --in-place '/exit 0/d' /etc/rc.local");
shell_exec("echo 'sleep 10' >> /etc/rc.local");
shell_exec("echo '/home/fos-streaming/fos/nginx/sbin/nginx_fos' >> /etc/rc.local");
shell_exec("echo '/home/fos-streaming/fos/php/sbin/php-fpm' >> /etc/rc.local");
shell_exec("echo 'exit 0' >> /etc/rc.local");
echo "#";
shell_exec("/bin/mkdir /home/fos-streaming/fos/www/hl > /dev/null 2>&1");
shell_exec("chmod -R 777 /home/fos-streaming/fos/www/hl > /dev/null 2>&1");
shell_exec("/bin/mkdir /home/fos-streaming/fos/www/cache > /dev/null 2>&1");
shell_exec("chmod -R 777 /home/fos-streaming/fos/www/cache > /dev/null 2>&1");
shell_exec("chown www-data:www-data /home/fos-streaming/fos/nginx/conf > /dev/null 2>&1");
shell_exec("/home/fos-streaming/fos/php/sbin/php-fpm");
shell_exec("/home/fos-streaming/fos/nginx/sbin/nginx_fos");
echo "#";
shell_exec("wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz -O /home/fos-streaming/ffmpeg-release-64bit-static.tar.xz > /dev/null 2>&1");
shell_exec("/bin/mkdir /usr/src/ffmpeg > /dev/null 2>&1");
shell_exec("tar -xJf /home/fos-streaming/ffmpeg-release-64bit-static.tar.xz -C /usr/src/ffmpeg > /dev/null 2>&1");
shell_exec("/bin/cp /usr/src/ffmpeg/ffmpeg*/ffmpeg /usr/local/bin/ffmpeg");
echo "#";
shell_exec("/bin/cp /usr/src/ffmpeg/ffmpeg*/ffprobe /usr/local/bin/ffprobe");
echo "#";
shell_exec("chmod 755 /usr/local/bin/ffmpeg > /dev/null 2>&1");
shell_exec("chmod 755 /usr/local/bin/ffprobe > /dev/null 2>&1");
echo "#";
shell_exec("chown www-data:root /usr/local/nginx/html > /dev/null 2>&1");
echo "#";
#shell_exec("/bin/rm -r /usr/src/ffmpeg > /dev/null 2>&1");
#shell_exec("/bin/rm -r /home/fos-streaming/ffmpeg-release-64bit-static.tar.xz > /dev/null 2>&1");
echo "]PASS \n";
echo "******************************************************************************************** \n";
echo "FOS-Streaming installed.. \n";
echo "visit management page: 'http://host:8000' \n";
echo "Login: \n";
echo "Username: admin \n";
echo "Password: admin \n";
echo "database details: \n";
echo "IMPORTANT: After you logged in, go to settings and check your ip-address. \n";
echo "******************************************************************************************** \n";
}
elseif(trim($arch) == "i686") {
echo "]PASS \n";
echo "3. [Installing needed files:]";
echo " [#";
shell_exec("apt-get install -y --force-yes libxml2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libbz2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libcurl4-openssl-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libmcrypt-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libmhash2 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libmhash-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpcre3 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpcre3-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes make > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes build-essential > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxslt1-dev git > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssl-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes git > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes php5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes unzip > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes python-software-properties > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpopt0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpq-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpq5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpspell-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libpthread-stubs0-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libpython-stdlib > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libqdbm-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libqdbm14 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libquadmath0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librecode-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librecode0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librtmp-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes librtmp0 > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libsasl2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsasl2-modules > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsctp-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsctp1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsensors4 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsensors4-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsm-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsm6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsnmp-base > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsnmp-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libsnmp-perl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsnmp30 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libsqlite3-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssh2-1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssh2-1-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libssl-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libstdc++-4.8-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libstdc++6-4.7-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libsybdb5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtasn1-3-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtasn1-6-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libterm-readkey-perl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtidy-0.99-0 > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libtidy-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtiff5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtiff5-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtiffxx5 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtimedate-perl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtinfo-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtool > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libtsan0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libunistring0 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libvpx-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libvpx1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libwrap0-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libx11-6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libx11-data > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libx11-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxau-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxau6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxcb1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxcb1-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes libxdmcp-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxdmcp6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxml2 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxml2-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxmltok1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxmltok1-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxpm-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxpm4 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxslt1-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxslt1.1 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxt-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes libxt6 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes linux-libc-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes m4 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes make > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes man-db > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes netcat-openbsd > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes odbcinst1debian2 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes openssl > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes patch > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes pkg-config > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes po-debconf > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python-minimal > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python2.7 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes python2.7-minimal > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes re2c > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes unixodbc > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes unixodbc-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes uuid-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes x11-common > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes x11proto-core-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes x11proto-input-dev > /dev/null 2>&1");
echo "#";
shell_exec("apt-get install -y --force-yes x11proto-kb-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes xorg-sgml-doctools > /dev/null 2>&1");
shell_exec("apt-get install -y libjpeg8 > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes xtrans-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes zlib1g-dev > /dev/null 2>&1");
shell_exec("apt-get install -y --force-yes php5-fpm > /dev/null 2>&1");
echo "]PASS \n";
echo "4. [FOS-Panel Installation:] ";
echo " [#";
$filename = '/usr/src/FOS-Streaming';
if (file_exists($filename)) {
shell_exec("/bin/rm -r /usr/src/FOS-Streaming > /dev/null 2>&1");
} else {
}
shell_exec("/usr/sbin/useradd -s /sbin/nologin -U -d /home/fos-streaming -m fosstreaming > /dev/null");
echo "##";
shell_exec("wget http://fos-streaming.com/fos-streaming_unpack_i686.tar.gz -O /home/fos-streaming/fos-streaming_unpack_i686.tar.gz > /dev/null 2>&1");
shell_exec("tar -xzf /home/fos-streaming/fos-streaming_unpack_i686.tar.gz -C /home/fos-streaming/ > /dev/null 2>&1");
shell_exec("/bin/rm -r /home/fos-streaming/fos-streaming_unpack_i686.tar.gz > /dev/null 2>&1");
shell_exec("/bin/mkdir /usr/src/FOS-Streaming > /dev/null 2>&1");
echo "##";
shell_exec("git clone https://github.com/zgelici/FOS-Streaming-v1.git /usr/src/FOS-Streaming/ > /dev/null 2>&1");
shell_exec("/bin/mv /usr/src/FOS-Streaming/* /home/fos-streaming/fos/www/ > /dev/null 2>&1");
shell_exec("wget https://getcomposer.org/installer -O /usr/src/installer > /dev/null 2>&1");
shell_exec("/usr/bin/php /usr/src/installer > /dev/null 2>&1");
shell_exec("/bin/cp /usr/src/composer.phar /usr/bin/composer.phar > /dev/null 2>&1");
shell_exec("/usr/bin/composer.phar install -d /home/fos-streaming/fos/www/ > /dev/null 2>&1");
echo "#";
shell_exec("echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffmpeg' >> /etc/sudoers");
shell_exec("echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffprobe' >> /etc/sudoers");
shell_exec("echo '*/2 * * * * www-data /usr/bin/php /home/fos-streaming/fos/www/cron.php' >> /etc/crontab");
echo "#";
shell_exec("sed --in-place '/exit 0/d' /etc/rc.local");
shell_exec("echo 'sleep 10' >> /etc/rc.local");
shell_exec("echo '/home/fos-streaming/fos/nginx/sbin/nginx_fos' >> /etc/rc.local");
shell_exec("echo '/home/fos-streaming/fos/php/sbin/php-fpm' >> /etc/rc.local");
shell_exec("echo 'exit 0' >> /etc/rc.local");
echo "#";
shell_exec("/bin/mkdir /home/fos-streaming/fos/www/hl > /dev/null 2>&1");
shell_exec("chmod -R 777 /home/fos-streaming/fos/www/hl > /dev/null 2>&1");
shell_exec("/bin/mkdir /home/fos-streaming/fos/www/cache > /dev/null 2>&1");
shell_exec("chmod -R 777 /home/fos-streaming/fos/www/cache > /dev/null 2>&1");
shell_exec("chown www-data:www-data /home/fos-streaming/fos/nginx/conf > /dev/null 2>&1");
shell_exec("/home/fos-streaming/fos/php/sbin/php-fpm");
shell_exec("/home/fos-streaming/fos/nginx/sbin/nginx_fos");
echo "#";
shell_exec("wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-32bit-static.tar.xz -O /home/fos-streaming/ffmpeg-release-32bit-static.tar.xz > /dev/null 2>&1");
shell_exec("/bin/mkdir /usr/src/ffmpeg > /dev/null 2>&1");
shell_exec("tar -xJf /home/fos-streaming/ffmpeg-release-32bit-static.tar.xz -C /usr/src/ffmpeg > /dev/null 2>&1");
shell_exec("/bin/cp /usr/src/ffmpeg/ffmpeg*/ffmpeg /usr/local/bin/ffmpeg");
echo "#";
shell_exec("/bin/cp /usr/src/ffmpeg/ffmpeg*/ffprobe /usr/local/bin/ffprobe");
echo "#";
shell_exec("chmod 755 /usr/local/bin/ffmpeg > /dev/null 2>&1");
shell_exec("chmod 755 /usr/local/bin/ffprobe > /dev/null 2>&1");
echo "#";
shell_exec("chown www-data:root /usr/local/nginx/html > /dev/null 2>&1");
echo "#";
#shell_exec("/bin/rm -r /usr/src/ffmpeg");
#shell_exec("/bin/rm -r /home/fos-streaming/ffmpeg-release-32bit-static.tar.xz > /dev/null 2>&1");
echo "]PASS \n";
echo "******************************************************************************************** \n";
echo "FOS-Streaming installed.. \n";
echo "visit management page: 'http://host:8000' \n";
echo "Login: \n";
echo "Username: admin \n";
echo "Password: admin \n";
echo "database details: \n";
echo "IMPORTANT: After you logged in, go to settings and check your ip-address. \n";
echo "******************************************************************************************** \n";
}
else {
echo "]FAIL \n";
echo "///////////////////////////////////////////////////// \n";
echo " Report this problem on www.fos-streaming.com \n";
echo ' Distro: ' . $release_info["DISTRIB_ID"] . "\n ";
echo 'Version: ' . $release_info["DISTRIB_RELEASE"] . "\n ";
echo 'Codename: ' . $release_info["DISTRIB_CODENAME"] . "\n ";
echo 'Discription: ' . $release_info["DISTRIB_DESCRIPTION"] . "\n ";
echo $arch;
echo "///////////////////////////////////////////////////// \n";
die();
}
?>