diff --git a/install_nginx.sh b/install_nginx.sh index 70bbe75..b84dbac 100644 --- a/install_nginx.sh +++ b/install_nginx.sh @@ -57,7 +57,7 @@ target_openssl_ver="1.1.1w" if [ "$(readlink -f `which openssl`)" == "/opt/openssl/bin/openssl" ]; then openssl_dir="/opt/openssl/ssl" openssl_source_dir="/root/openssl-$target_openssl_ver" - if [ -z `sudo readlink -f "$openssl_source_dir"` ]; then + if [ ! -e "$openssl_source_dir" ] || [ -z `readlink -f "$openssl_source_dir"` ]; then force_reinstall_openssl="1" else if [ -d /opt/openssl/ssl/certs ] && [ ! -L /opt/openssl/ssl/certs ]; then @@ -254,6 +254,7 @@ if [[ $(vercomp "$nginx_ver" "$nginx_target_ver") == "<" ]] || [[ "$1" == '--fo fi if [[ $nginx_conf_exist == "0" ]]; then nginx_conf_path="/etc/nginx/nginx.conf" + sudo cp -f /etc/nginx/nginx.conf /etc/nginx/nginx_bak.conf server_block_start=`sudo grep -E '^\s*server\s*{' $nginx_conf_path -n|cut -d : -f 1` http_block_start=`sudo grep -E '^\s*http\s*{' $nginx_conf_path -n|cut -d : -f 1` http_block_end_offset=`cat $nginx_conf_path | awk '{if (NR>='$http_block_start') print}'|grep -E '^}' -n|cut -d : -f 1|xargs|awk '{print $1}'`