]> gitweb.morketsmerke.org Git - immudex.git/commitdiff
Poprawienie skryptu immudex-crypt. Dopisanie informacji o obsługdze LVM do funkcji...
authorxf0r3m <jakubstasinski@protonmail.com>
Sun, 6 Jul 2025 14:56:15 +0000 (16:56 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Sun, 6 Jul 2025 14:56:15 +0000 (16:56 +0200)
tools/sbin/immudex-crypt

index d951a5fbf1eab2aa8e4a91352aa53268aa895ec9..ec76d6856a6594453f28a22cd4a4acf61c327ce6 100755 (executable)
@@ -15,6 +15,12 @@ function help() {
   echo "# immudex-crypt create <disk partition>";
   echo "# immudex-crypt open <crypt_LUKS device>";
   echo "# immudex-crypt close immudex-crypt[0-9] | ic[0-9] | [0-9]";
+  echo "LVM prep:";
+  echo "It's possible to mount EXT4 LV with your data, behind LUKS. For now";
+  echo "only open function works, so you need prepare whole LVM structure on";
+  echo "your disk or partition even with file system instalation. If there is";
+  echo "only one EXT4 LV it will be mounted automaticly, but if there is more";
+  echo "than one, you will be asked to choose which one shoud be mounted.";
 }
 
 function list() {
@@ -29,12 +35,16 @@ function list() {
   if [ "$mapperDeviceList" ]; then
          for dmDevice in $mapperDeviceList; do
                    if cryptsetup status /dev/mapper/${dmDevice} > /dev/null 2>&1; then
-                           mountPoint=$(df --output=source,target /media/${USER}/${dmDevice} | tail -n 1 | awk '{printf $2}');
+                           mountPoint=$(df --output=source,target /dev/mapper/${dmDevice} | tail -n 1 | awk '{printf $2}');
           device=$(sudo cryptsetup status /dev/mapper/${dmDevice} | grep "device" | awk '{printf $2}');
                  if [ "$mountPoint" ] && [ "$mountPoint" != "/dev" ]; then
             echo -e "$device\t /dev/mapper/${dmDevice}\t$mountPoint"; 
           else
-            echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted";
+            if $(sudo blkid | grep "${dmDevice}" | grep -q "LVM2_member"); then
+              echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted (LVM2_member)";
+            else
+              echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted";
+            fi
                            fi
                    fi
            done