Compare commits
4 Commits
cpvid
...
bc380a60a4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc380a60a4 | ||
|
|
d9d691db1d | ||
|
|
e2a09dcaaf | ||
|
|
8a64ccaa3f |
@@ -1 +1 @@
|
|||||||
Scripts to automate VPS setup and maintenance
|
Some scripts to automate VPS setup
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
|
# https://habr.com/ru/articles/735712/
|
||||||
T=$SDIR/../step
|
certbot certonly --manual --preferred-challenges http -d "kornerr.ru"
|
||||||
|
|
||||||
STEP=0
|
|
||||||
source $T/ensureRootUser
|
|
||||||
source $T/renewCertbot
|
|
||||||
|
|||||||
@@ -2,22 +2,10 @@
|
|||||||
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
|
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
|
||||||
T=$SDIR/../step
|
T=$SDIR/../step
|
||||||
|
|
||||||
ACME_FILE=$1
|
|
||||||
ACME_VALUE=$2
|
|
||||||
|
|
||||||
if [ -z "$ACME_FILE" ] || [ -z "$ACME_VALUE" ]; then
|
|
||||||
echo "Usage: $0 ACME_FILE ACME_VALUE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
ACME_DIR="/var/www/html/.well-known/acme-challenge"
|
|
||||||
|
|
||||||
STEP=0
|
STEP=0
|
||||||
source $T/ensureRootUser
|
source $T/ensureRootUser
|
||||||
source $T/copyNginxACMEConfig
|
source $T/copyNginxACMEConfig
|
||||||
source $T/restartNginx
|
source $T/restartNginx
|
||||||
source $T/createACMEChallenge
|
|
||||||
source $T/waitForReturnKey
|
|
||||||
source $T/deleteACMEChallenge
|
|
||||||
source $T/copyNginxProdConfig
|
source $T/copyNginxProdConfig
|
||||||
source $T/restartNginx
|
source $T/restartNginx
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ fi
|
|||||||
# Get the latest changes
|
# Get the latest changes
|
||||||
cd $REPO_DIR
|
cd $REPO_DIR
|
||||||
git checkout -f $MAIN_BRANCH
|
git checkout -f $MAIN_BRANCH
|
||||||
git clean -fd
|
|
||||||
git fetch --all
|
git fetch --all
|
||||||
git pull
|
|
||||||
|
|
||||||
# Find out the latest commit in the whole repo
|
# Find out the latest commit in the whole repo
|
||||||
#git branch -av --sort=-committerdate
|
#git branch -av --sort=-committerdate
|
||||||
|
|||||||
@@ -13,4 +13,3 @@ rsync -aivc --delete $DBG_DIR/ $DST_DIR
|
|||||||
cd $DST_DIR
|
cd $DST_DIR
|
||||||
ln -s ../cbr
|
ln -s ../cbr
|
||||||
ln -s ../dbg
|
ln -s ../dbg
|
||||||
ln -s ../vid
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
STEP=$((STEP+1))
|
|
||||||
echo -e "\n> > > > Шаг №$STEP. Создаём файл проверки для ACME"
|
|
||||||
mkdir -p $ACME_DIR
|
|
||||||
echo "$ACME_VALUE" > "$ACME_DIR/$ACME_FILE"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
STEP=$((STEP+1))
|
|
||||||
echo -e "\n> > > > Шаг №$STEP. Удаляем файл проверки для ACME"
|
|
||||||
rm $ACME_DIR/$ACME_FILE
|
|
||||||
rmdir $ACME_DIR
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
# https://habr.com/ru/articles/735712/
|
|
||||||
|
|
||||||
STEP=$((STEP+1))
|
|
||||||
echo -e "\n> > > > Шаг №$STEP. Просим certbot обновить"
|
|
||||||
certbot certonly --manual --preferred-challenges http -d "kornerr.ru"
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
STEP=$((STEP+1))
|
|
||||||
echo -e "\n> > > > Шаг №$STEP. Ожидаем нажатия клавиши Return"
|
|
||||||
read -p "Нажмите Return..."
|
|
||||||
Reference in New Issue
Block a user