Update setup script

This commit is contained in:
Robert Partridge 2022-07-20 14:57:26 -04:00
parent e031cb6f81
commit 7cc951cf1f
1 changed files with 10 additions and 17 deletions

View File

@ -7,36 +7,29 @@ clear
# URL: https://gitea.techaddressed.com/robert/setup-nginx-proxy
# *****************************************************************************
# check for root privileges
echo
if [ "$EUID" -ne 0 ]
then echo "PLEASE RUN THIS SCRIPT WITH ROOT PRIVILEGES"
exit
fi
# update system
apt update && apt upgrade -y && apt autoremove -y && apt clean
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean
# install packages
apt install ntp nginx certbot ufw -y
sudo apt install ntp nginx certbot ufw -y
# copy scripts
mkdir ~/bin
cp scripts/*.sh ~/bin
# copy config files
cp config/example* /etc/nginx/sites-available/
cp config/mime.types /etc/nginx/
cp config/nginx.conf /etc/nginx/
cp config/cloudflare-only.conf /etc/nginx/
cp config/*realip.conf /etc/nginx
sudo cp config/example* /etc/nginx/sites-available/
sudo cp config/mime.types /etc/nginx/
sudo cp config/nginx.conf /etc/nginx/
sudo cp config/cloudflare-only.conf /etc/nginx/
sudo cp config/*realip.conf /etc/nginx
# restart services
systemctl restart nginx
sudo systemctl restart nginx
# configure ufw firewall but do not enable
ufw allow 80/tcp
ufw allow 443/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# complete
echo