summaryrefslogtreecommitdiffstats
path: root/.root/usr/local/bin/encrypted
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov2070@gmail.com>2024-04-11 13:00:50 +0300
committerjustanothercatgirl <sotov2070@gmail.com>2024-04-11 13:00:50 +0300
commit732e507db3c1664d6d64889b3186df766c9217d4 (patch)
tree2154441af35257c85a0c1aa33a4a6b9e8c0063d8 /.root/usr/local/bin/encrypted
parentdbb48f0acaacede21cfccfb8f30a206236520068 (diff)
added group-media script
Diffstat (limited to '.root/usr/local/bin/encrypted')
-rwxr-xr-x.root/usr/local/bin/encrypted6
1 files changed, 6 insertions, 0 deletions
diff --git a/.root/usr/local/bin/encrypted b/.root/usr/local/bin/encrypted
index b3132c6..73e2ff0 100755
--- a/.root/usr/local/bin/encrypted
+++ b/.root/usr/local/bin/encrypted
@@ -9,6 +9,12 @@ encrypted_datasets=("zfsroot/encrypted")
function __mount() {
for i in "${encrypted_datasets[@]}"; do
+ zfs list -o mounted "$i" | grep --quiet yes
+ if [ $? -eq 0 ]; then
+ echo "Dataset $i is already mounted. Skipping."
+ continue
+ fi
+
zfs load-key "$i";
if [ $? -ne 0 ]; then
echo "Error importing the key! Aborting dataset ${i}"