Skip to content

Instantly share code, notes, and snippets.

@centminmod
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save centminmod/9003270 to your computer and use it in GitHub Desktop.
Save centminmod/9003270 to your computer and use it in GitHub Desktop.
centmin mod 1.2.3-eva2000.06 quick fix to properly disable ngx_pagespeed download process when centmin.sh has NGINX_PAGESPEED=n set
nginxpgspeedtarball() {
if [[ "$NGINX_PAGESPEED" = [yY] ]]; then
cd $DIR_TMP
# official github master zip renamed
if [[ "$NGINX_PAGESPEEDGITMASTER" = [yY] ]]; then
cecho "Download release-${NGXPGSPEED_VER}.tar.gz ..." $boldyellow
if [ -s release-${NGXPGSPEED_VER}.tar.gz ]; then
cecho "release-${NGXPGSPEED_VER}.tar.gz Archive found, skipping download..." $boldgreen
else
wget -c --progress=bar --no-check-certificate https://github.com/pagespeed/ngx_pagespeed/archive/master.tar.gz -O release-${NGXPGSPEED_VER}.tar.gz --tries=3
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: release-${NGXPGSPEED_VER}.tar.gz download failed." $boldgreen
checklogdetails
exit #$ERROR
else
cecho "Download done." $boldyellow
#echo ""
fi
fi
fi # NGINX_PAGESPEEDGITMASTER
cecho "Download release-${NGXPGSPEED_VER}.tar.gz ..." $boldyellow
if [ -s release-${NGXPGSPEED_VER}.tar.gz ]; then
cecho "release-${NGXPGSPEED_VER}.tar.gz Archive found, skipping download..." $boldgreen
else
wget -c --progress=bar --no-check-certificate https://github.com/pagespeed/ngx_pagespeed/archive/release-${NGXPGSPEED_VER}.tar.gz -O release-${NGXPGSPEED_VER}.tar.gz --tries=3
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: release-${NGXPGSPEED_VER}.tar.gz download failed." $boldgreen
checklogdetails
exit #$ERROR
else
cecho "Download done." $boldyellow
#echo ""
fi
fi
tar xzf release-${NGXPGSPEED_VER}.tar.gz
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: release-${NGXPGSPEED_VER}.tar.gz extraction failed." $boldgreen
checklogdetails
exit #$ERROR
else
cecho "release-${NGXPGSPEED_VER}.tar.gz valid file." $boldyellow
echo ""
fi
if [[ "$NGINX_PAGESPEEDGITMASTER" = [yY] ]]; then
\cp -Rf ngx_pagespeed-master ngx_pagespeed-release-${NGXPGSPEED_VER}
rm -rf ngx_pagespeed-master
rm -rf release-${NGXPGSPEED_VER}.tar.gz
fi
cecho "Download ${NGINX_PAGESPEEDPSOL_VER}.tar.gz ..." $boldyellow
if [ -s ${NGINX_PAGESPEEDPSOL_VER}.tar.gz ]; then
cecho "${NGINX_PAGESPEEDPSOL_VER}.tar.gz Archive found, skipping download..." $boldgreen
else
cd $DIR_TMP/ngx_pagespeed-release-${NGXPGSPEED_VER}
wget -c --progress=bar --no-check-certificate https://dl.google.com/dl/page-speed/psol/${NGINX_PAGESPEEDPSOL_VER}.tar.gz --tries=3
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: ${NGINX_PAGESPEEDPSOL_VER}.tar.gz download failed." $boldgreen
checklogdetails
exit #$ERROR
else
cecho "Download done." $boldyellow
#echo ""
fi
fi
tar xzf ${NGINX_PAGESPEEDPSOL_VER}.tar.gz
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: ${NGINX_PAGESPEEDPSOL_VER}.tar.gz extraction failed." $boldgreen
checklogdetails
exit #$ERROR
else
cecho "${NGINX_PAGESPEEDPSOL_VER}.tar.gz valid file." $boldyellow
cd $DIR_TMP
echo ""
fi
fi # NGINX_PAGESPEED=y
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment