Files
VPS-scripts_Ubuntu-Web-V1/Brotli/setup-updater.sh
2019-01-18 10:39:05 +01:00

36 lines
1.3 KiB
Bash

#!/bin/bash
###============================================================
## Ubuntu 18.04 Brotli updater Dependencies installer
###============================================================
# RUN THIS ONCE
##=============================================================
##Nginx Config Example
#location /deb/nginx-brotli/{
#alias /var/www/brotli-builds/;
#autoindex on;
#}
##
##=============================================================#
#install Dependencies
apt install -y curl gnupg dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev unzip apt-show-versions git
#add repo
curl -L https://nginx.org/keys/nginx_signing.key | apt-key add -
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/apt/nginx.list -O /etc/apt/sources.list.d/nginx.list
apt update
#Checking for local version log
if [ ! -f /var/log/nginxVersion.txt ]; then
echo 0 > /var/log/nginxVersion.txt
fi
#downloading Brotli updater scrips
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/Brotli/update-brotli.sh -O /opt/update-brotli.sh
sed -i "\$a0 2 * * 1 root /bin/bash /opt/update-brotli.sh >/dev/null 2>&1" /etc/crontab
# setting webserver folder for package downloads
mkdir -p /var/www/brotli-builds
chown www-data:www-data /var/www/brotli-builds