From 9a2634719054296586e31621a1e6a56b944f8062 Mon Sep 17 00:00:00 2001 From: bprieshof Date: Thu, 17 Jan 2019 12:29:34 +0100 Subject: [PATCH] Add 'Brotli/update-brotli.sh' --- Brotli/update-brotli.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Brotli/update-brotli.sh diff --git a/Brotli/update-brotli.sh b/Brotli/update-brotli.sh new file mode 100644 index 0000000..795d18c --- /dev/null +++ b/Brotli/update-brotli.sh @@ -0,0 +1,30 @@ +#!/bin/bash +###============================================================ +## Ubuntu 18.04 Brotli updater +###============================================================ +# Make sure to install all Dependencies +# +##============================================================= + +#Setting versions variabless +newver=$(apt-show-versions -a nginx:amd64 | grep -o -P '(?<=amd64 ).*(?=~bionic bionic nginx.org)') +curver=$(cat /var/log/nginxVersion.txt) +echo curent=$curver + +if [ $newver \> $curver ]; then + #updating stored versions number + echo $newver > /var/log/nginxVersion.txt + # building nginx module + #source Nginx + cd /usr/local/src + apt source nginx + apt build-dep nginx -y + + # building nginx + cd /usr/local/src/nginx-*/ + sed -i -e 's/ssl_preread_module --with-c/ssl_preread_module --add-module=\/usr\/local\/src\/ngx_brotli --with-c/g' debian/rules + sudo dpkg-buildpackage -b -uc -us + #DEB files are in /usr/local/src + mv *.deb /var/www/brotli-builds + rm -rf /usr/local/src/nginx-*/ +fi