1
0
forked from clan/clan-core

postgres: handle restores without associated systemd service

This commit is contained in:
Jörg Thalheim 2024-06-14 11:14:49 +02:00
parent ec49d1f844
commit 870948306d

View File

@ -159,8 +159,12 @@ in
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}"
runuser -u postgres -- dropdb "${db.name}"