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
+16 -2
View File
@@ -13,6 +13,18 @@ if [ "${DAVTOKEN_USER}." == "." ]; then
get_nc_token
fi
#Check if encrypted Dir is mounted
if [ ${IPAVAULTUSE} == "true" ]; then
grep ${DECRYPTEDDATADIR} /etc/mtab >/dev/null
if [ $? -ne 0 ]; then
echo "Error: IPAVAULTUSE is set to true, but the Directory is not mounted. "
echo "Press any key to continue"
read -n 1 -s -r
echo ""
exit 1
fi
fi
# Use optional Profilename
profilename=${3:-"default"}
@@ -73,7 +85,8 @@ if [[ $? -ne 0 ]]; then
echo "****"
echo ""
echo "Please check if your Token is setup right and for the Output"
read -n 1 -s -r -p "Press any key to continue"
echo "Press any key to continue"
read -n 1 -s -r
echo ""
exit 1
fi
@@ -87,7 +100,8 @@ if [ "${RUNCMD}." != "." ]; then
echo "****"
echo ""
echo "Error running ${1}, not syncing Profile!"
read -n 1 -s -r -p "Press any key to continue"
echo "Press any key to continue"
read -n 1 -s -r
echo ""
exit 2
fi