From 7bc0a29fa033222b625de8083cb940d547023757 Mon Sep 17 00:00:00 2001 From: Lars Hahn Date: Wed, 24 Jul 2024 13:47:46 +0200 Subject: [PATCH] templates/usr/local/bin/authentik-backup.sh.j2 aktualisiert Storing idea about having nice backup script --- .../usr/local/bin/authentik-backup.sh.j2 | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/templates/usr/local/bin/authentik-backup.sh.j2 b/templates/usr/local/bin/authentik-backup.sh.j2 index 2773659..32ea293 100644 --- a/templates/usr/local/bin/authentik-backup.sh.j2 +++ b/templates/usr/local/bin/authentik-backup.sh.j2 @@ -28,4 +28,30 @@ docker exec -i $POSTGRES_DOCKER_ID /usr/local/bin/dropdb --username {{ authentik docker exec -i $POSTGRES_DOCKER_ID /usr/local/bin/createdb --username {{ authentik_db.user }} '{{ authentik_db.name }}' docker exec -i $POSTGRES_DOCKER_ID /usr/local/bin/psql --username {{ authentik_db.user }} -d {{ authentik_db.name }} < $TARGETFOLDER/authentik-postgres-backup.sql docker-compose down -docker-compose up -d \ No newline at end of file +docker-compose up -d + + +( + flock -n 9 || { + echo "PERFORMANCE TEST ABORTED! ALREADY RUNNING!"; + exit 1; + } + + if [[ $(id -u) != 0 ]]; then + echo "Performance test aborted; please become root in order to run a performance test."; + exit 1; + fi + + case $tooling in + "atlassian") + echo "blah"; + ;; + *) + # I know this looks stupid, only one case, but in future we want to use TaaS/TReX aswell... + # So let's make it future safe! + echo -e "Invalid tooling '$tooling'.Please check help for correct list." + exit 1 + ;; + esac + echo "" +) 9>/var/run/lock/devstack-loadtest.lock; \ No newline at end of file