#!/bin/bash CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" echo CURRENT DIR is $CUR_DIR echo "root $CUR_DIR/nginx/html;" > /etc/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/nginx/nginx.conf systemctl restart nginx systemctl enable nginx