Fixes nasty bug, where in specific condition, it could erase backup
This commit is contained in:
parent
bcf10ea715
commit
84d8727eef
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
[Unit]
|
||||
Description=Initializer
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
@ -11,7 +12,12 @@ ExecStartPre=/bin/bash -euxc ' \
|
|||
git clone $BACKUP_DESTINATION:%i /data/domains/%i; \
|
||||
cd /data/domains/%i; \
|
||||
else \
|
||||
ssh $BACKUP_DESTINATION "mkdir -p %i;cd %i;git init --bare;"; \
|
||||
ssh $BACKUP_DESTINATION " \
|
||||
if [ ! -d %i ]; then \
|
||||
mkdir -p %i; \
|
||||
cd %i; \
|
||||
git init --bare; \
|
||||
fi"; \
|
||||
if [ ! -d /data/domains/%i ]; then \
|
||||
mkdir /data/domains/%i; \
|
||||
fi; \
|
||||
|
|
Loading…
Reference in a new issue