Fixed checking for correct mount of encrypted directory

This commit is contained in:
Daniel Pätzold
2026-03-13 18:14:58 +01:00
parent b1e5752318
commit 445c52fb27
3 changed files with 20 additions and 7 deletions
+2 -4
View File
@@ -41,10 +41,7 @@ else
echo "No Key found. Will try to Setup a new one."
ENCKEY=$( openssl rand -base64 24 )
echo ${ENCKEY} > /var/tmp/IPAVAULTKEY.txt
ipa vault-add "${IPAVAULTNAME}" --desc "Key for Fileencrytption of ${HOSTNM}" --type=standard
if [ $? -eq 0 ]; then
ipa vault-archive "${IPAVAULTNAME}" --in /var/tmp/IPAVAULTKEY.txt
fi
ipa vault-add "${IPAVAULTNAME}" --desc "Key for Fileencrytption of ${HOSTNM}" --type=standard && ipa vault-archive "${IPAVAULTNAME}" --in /var/tmp/IPAVAULTKEY.txt
if [ $? -eq 0 ]; then
echo
echo "Your Key has been sucessfully stored to the Vault ${IPAVAULTNAME}"
@@ -59,6 +56,7 @@ else
echo
else
echo "Failed to create the Vault. Please check the Errors and try again."
ENCKEY=""
fi
else
ENCKEY=$( cat /var/tmp/IPAVAULTKEY.txt )