add some steps
This commit is contained in:
11
cert/vpsRenew
Executable file
11
cert/vpsRenew
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
|
||||||
|
T=$SDIR/../step
|
||||||
|
|
||||||
|
STEP=0
|
||||||
|
source $T/ensureRootUser
|
||||||
|
source $T/copyNginxACMEConfig
|
||||||
|
source $T/restartNginx
|
||||||
|
|
||||||
|
source $T/copyNginxProdConfig
|
||||||
|
source $T/restartNginx
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
apt install nginx
|
|
||||||
cp nginx/cfg /etc/nginx/sites-enabled/default
|
|
||||||
systemctl restart nginx
|
|
||||||
9
nginx/setup
Executable file
9
nginx/setup
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
|
||||||
|
T=$SDIR/../step
|
||||||
|
|
||||||
|
STEP=0
|
||||||
|
source $T/ensureRootUser
|
||||||
|
source $T/installNginx
|
||||||
|
source $T/copyNginxProdConfig
|
||||||
|
source $T/restartNginx
|
||||||
5
step/copyNginxACMEConfig
Normal file
5
step/copyNginxACMEConfig
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STEP=$((STEP+1))
|
||||||
|
echo -e "\n> > > > Шаг №$STEP. Копируем настройки Nginx для ACME"
|
||||||
|
cp $SDIR/../nginx/cfg-acme /etc/nginx/sites-enabled/default
|
||||||
5
step/copyNginxProdConfig
Normal file
5
step/copyNginxProdConfig
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STEP=$((STEP+1))
|
||||||
|
echo -e "\n> > > > Шаг №$STEP. Копируем боевые настройки Nginx"
|
||||||
|
cp $SDIR/../nginx/cfg /etc/nginx/sites-enabled/default
|
||||||
9
step/ensureRootUser
Normal file
9
step/ensureRootUser
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# https://askubuntu.com/a/15856
|
||||||
|
|
||||||
|
STEP=$((STEP+1))
|
||||||
|
echo -e "\n> > > > Шаг №$STEP. Проверяем запуск из-под root"
|
||||||
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
echo "ОШИБКА: Перезапустите как root"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
5
step/installNginx
Normal file
5
step/installNginx
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STEP=$((STEP+1))
|
||||||
|
echo -e "\n> > > > Шаг №$STEP. Устанавливаем Nginx"
|
||||||
|
apt install nginx
|
||||||
5
step/restartNginx
Normal file
5
step/restartNginx
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STEP=$((STEP+1))
|
||||||
|
echo -e "\n> > > > Шаг №$STEP. Перезапускаем Nginx"
|
||||||
|
systemctl restart nginx
|
||||||
Reference in New Issue
Block a user