-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathnginx_upgrade.sh
49 lines (38 loc) · 1.45 KB
/
nginx_upgrade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
#####################################################
# Created by cryptopool.builders for crypto use...
#####################################################
source /etc/functions.sh
source /etc/multipool.conf
source $STORAGE_ROOT/yiimp/.yiimp.conf
cd /tmp
# NGINX upgrade
echo -e " Upgrading NGINX...$COL_RESET"
#Grab Nginx key and proper mainline package for distro
echo "deb http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list >/dev/null 2>&1
hide_output sudo wget https://nginx.org/keys/nginx_signing.key
wait $!
hide_output sudo apt-key add nginx_signing.key
wait $!
hide_output sudo apt-get update;
wait $!
apt_install nginx;
wait $!
# Make additional conf directories, move and generate needed configurations.
sudo mkdir -p /etc/nginx/cryptopool.builders
sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old
sudo cp -r /tmp/nginx.conf /etc/nginx/
sudo cp -r /tmp/general.conf /etc/nginx/cryptopool.builders
sudo cp -r /tmp/php_fastcgi.conf /etc/nginx/cryptopool.builders
sudo cp -r /tmp/security.conf /etc/nginx/cryptopool.builders
sudo cp -r /tmp/letsencrypt.conf /etc/nginx/cryptopool.builders
# Removing default nginx site configs.
sudo rm -r /etc/nginx/conf.d/default.conf
sudo rm -r /etc/nginx/sites-enabled/default*
sudo rm -r /etc/nginx/sites-available/default*
restart_service nginx;
wait $!
restart_service php7.3-fpm;
wait $!
echo -e "$GREEN Done...$COL_RESET"