diff options
Diffstat (limited to '.root/usr/local/bin/encrypted')
-rwxr-xr-x | .root/usr/local/bin/encrypted | 6 |
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}" |