forked from clan/clan-core
postgres: handle restores without associated systemd service
This commit is contained in:
parent
ec49d1f844
commit
870948306d
@ -159,8 +159,12 @@ in
|
|||||||
|
|
||||||
if [[ -e "${current}" ]]; then
|
if [[ -e "${current}" ]]; then
|
||||||
(
|
(
|
||||||
systemctl stop ${lib.concatStringsSep " " db.restore.stopOnRestore}
|
${
|
||||||
trap "systemctl start ${lib.concatStringsSep " " db.restore.stopOnRestore}" EXIT
|
lib.optionalString (db.restore.stopOnRestore != [ ]) ''
|
||||||
|
systemctl stop ${builtins.toString db.restore.stopOnRestore}
|
||||||
|
trap "systemctl start ${builtins.toString db.restore.stopOnRestore}" EXIT
|
||||||
|
''
|
||||||
|
}
|
||||||
|
|
||||||
mkdir -p "${folder}"
|
mkdir -p "${folder}"
|
||||||
runuser -u postgres -- dropdb "${db.name}"
|
runuser -u postgres -- dropdb "${db.name}"
|
||||||
|
Loading…
Reference in New Issue
Block a user