forked from streamlinevideo/streamline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildServer.sh
executable file
·23 lines (13 loc) · 907 Bytes
/
buildServer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Upgrade the OS
sudo apt-get -y update && sudo apt-get -y upgrade
# Make a directory to write from and read from for the caddy server
mkdir /home/ubuntu/streamline/www
# Make it writable
sudo chmod 775 /home/ubuntu/streamline/www
# Create cron jobs that remove old video manifests or segments after one minute after creation.
# Playlists will be pushed in constantly including the variant playlist, so, they should be unaffected unless stale.
(crontab -l 2>/dev/null; echo "* * * * * find /home/ubuntu/streamline/www/*.ts -mmin +1 -print0 | xargs -0 rm -r") | crontab -
(crontab -l 2>/dev/null; echo "* * * * * find /home/ubuntu/streamline/www/*.m3u8 -mmin +1 -print0 | xargs -0 rm -r") | crontab -
# Provide the command needed to set up the caddy server. (personal license)
echo "Please run: curl https://getcaddy.com | bash -s personal hook.service,http.cors,http.upload"