I have a
nginx -V 2>&1 | \
grep -qi 'nginx/1.9.10\|ngx_pagespeed-release-1.9.32.10\|openssl-1.0.2f\|modsecurity-2.9.0' \
&& echo "has the stuff we need" \
|| echo "missing something"
which is going against
[root@mage2appblock vagrant]# nginx -V
nginx version: nginx/1.9.10
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
built with OpenSSL 1.0.2f 28 Jan 2016
TLS SNI support enabled
configure arguments: --user=www-data --group=www-data
--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid
--lock-path=/var/lock/subsys/nginx
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp
--add-module=/src/nginx/ngx_pagespeed-release-1.9.32.10-beta
--add-module=/src/nginx/modsecurity-2.9.0/nginx/modsecurity
--with-http_auth_request_module --with-http_sub_module
--with-http_mp4_module --with-http_flv_module
--with-http_addition_module --with-http_dav_module
--with-http_gunzip_module --with-http_gzip_static_module
--with-http_stub_status_module --with-http_sub_module
--with-http_v2_module --with-http_ssl_module
--with-openssl=/src/nginx/openssl-1.0.2f
--with-sha1=/usr/include/openssl
--with-md5=/usr/include/openssl --with-pcre --with-ipv6
--with-file-aio --with-http_realip_module
--without-http_scgi_module --without-http_uwsgi_module
Seems that if I change the substrings from
'nginx/1.9.10\|ngx_pagespeed-release-1.9.32.10\|openssl-1.0.2f\|modsecurity-2.9.0'
to
'nginx/1.9.10\|ngx_pagespeed-release-1.9.32.10\|openssl-1.0.2f\|modsecurity-2.9.1'
I still get "has the stuff we need"
even though not everything was present. I need to match all or nothing.
and
version, ok..out=$(nginx -V 2>&1); echo $out | grep -qi "nginx/1.9.10" | grep -qi "ngx_pagespeed-release-1.9.32.10" | grep -qi "openssl-1.0.2f" | grep -qi "modsecurity-2.9.0" && echo "has the stuff we need" || echo "missing something"
is always hitting"missing something"
when it is true..