Skip to content

Commit

Permalink
switch nginx version check to https url
Browse files Browse the repository at this point in the history
  • Loading branch information
centminmod committed Jun 15, 2016
1 parent 11ff140 commit 86e5451
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/cpcheck.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set_logdate() {

ngxver_checker() {
if [[ "$(which nginx >/dev/null 2>&1; echo $?)" = '0' ]]; then
LASTEST_NGINXVERS=$(curl -sL http://nginx.org/en/download.html 2>&1 | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n1 2>&1)
LASTEST_NGINXVERS=$(curl -sL https://nginx.org/en/download.html 2>&1 | egrep -o "nginx\-[0-9.]+\.tar[.a-z]*" | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 1 2>&1)
CURRENT_NGINXVERS=$(nginx -v 2>&1 | awk -F '/' '{print $2}')
if [[ "$CURRENT_NGINXVERS" != "$LASTEST_NGINXVERS" ]]; then
echo
Expand Down

0 comments on commit 86e5451

Please sign in to comment.