#!/bin/bash CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" echo CURRENT DIR is $CUR_DIR result=`rpm -q -a | grep nginx` if [ "" = "$result" ]; then echo nginx is not installed, please retry again. exit 1 else echo "root $CUR_DIR/nginx/html;" > /etc/opt/rh/rh-nginx116/nginx/conf.d/root.conf f=$CUR_DIR while [[ $f != / ]]; do chmod og+x "$f"; f=$(dirname "$f"); done; yes | cp -rf $CUR_DIR/nginx.conf /etc/opt/rh/rh-nginx116/nginx/nginx.conf systemctl restart rh-nginx116-nginx systemctl enable rh-nginx116-nginx fi