From 586624fc806b16b4a1804ea351fd5c1d8a3df121 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 11 Mar 2025 16:04:35 +0100
Subject: [PATCH] Improve setup scripts;

---
 testing/scripts/setup_secrets_root.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/testing/scripts/setup_secrets_root.sh b/testing/scripts/setup_secrets_root.sh
index 92f0c12..413eb0e 100755
--- a/testing/scripts/setup_secrets_root.sh
+++ b/testing/scripts/setup_secrets_root.sh
@@ -35,4 +35,12 @@ cp -a "${PATH_SOURCE}" "${PATH_SECRETS}"
 pumount "${SECRETS_DEV}"
 echo "You can remove ${PATH_DEV} now."
 chown -R "${USERNAME}:${USERNAME}" "${PATH_SECRETS}"
-sudo -u "${USERNAME}" ./setup_secrets_user.sh "${SECRETS_PASS}"
+
+cd ../..
+PATH_REPO=$(pwd)
+CONTAINS_TICK=$(echo "${SECRETS_PASS}" | grep "'" | wc -l)
+if [ "${CONTAINS_TICK}" = "1" ]; then
+  echo "Cannot pass to user script passphrase with illegal character, aborting."
+  exit 1
+fi
+su -l "${USERNAME}" -c "cd ${PATH_REPO}/testing/scripts && ./setup_secrets_user.sh '${SECRETS_PASS}'"
-- 
2.30.2