From 078c1d7b03585269015a6213d72df2fbde2eb9e6 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Fri, 9 Jun 2023 12:56:49 +0200 Subject: [PATCH] feat: optionally get password from file --- get_password.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/get_password.sh b/get_password.sh index d6f08d8..9cad8fc 100755 --- a/get_password.sh +++ b/get_password.sh @@ -1,3 +1,8 @@ #!/bin/sh -pass ansible-vault +PASSFILE="/srv/secrets/ansible_vault_pass" +if [ -f "$PASSFILE" ]; then + doas cat "$PASSFILE" +else + pass ansible-vault +fi