From 065f7a943836dd23bc6b6c12523230ef8e2fc24a Mon Sep 17 00:00:00 2001 From: primardj Date: Tue, 23 Jan 2024 17:41:50 +0000 Subject: [PATCH] delete old script dmount.sh and dumount.sh --- dmount.sh | 31 ---------------------------- dumount.sh | 59 ------------------------------------------------------ 2 files changed, 90 deletions(-) delete mode 100755 dmount.sh delete mode 100755 dumount.sh diff --git a/dmount.sh b/dmount.sh deleted file mode 100755 index 24e9d49..0000000 --- a/dmount.sh +++ /dev/null @@ -1,31 +0,0 @@ -#/bin/bash - -#def constantes. - -Version=1.0.0 -Usage="dmount.sh [PARAMETTER] - -Permit to mount an LVM on LUKS device when you have already added to /etc/fstab all volumes. - -PARAMETER - -h, --help Print this help and exit - -v, --version Print the version of this program and exit - " - -for i in $@; do - case "$i" in - "-h" | "--help") - echo "${Usage}" - exit 0 - ;; - "-v" | "--version") - echo "dmount.sh v.${Version}" - exit 0 - ;; - esac -done - -echo "unlocking device cryptdata" -doas rc-service dmcrypt restart -doas vgchange -a y cryptdata -doas mount -a diff --git a/dumount.sh b/dumount.sh deleted file mode 100755 index c682e1f..0000000 --- a/dumount.sh +++ /dev/null @@ -1,59 +0,0 @@ -#/bin/bash - - -Version=1.0.0 -Usage="dumount.sh [PARAMETTER] - -Umount a LVM on LUKS device. In case it was unplugged without being unmounted, use dmsetup tu force the deactivation of the lvm drive. - -PARAMETER - -h, --help Print this help and exit - -v, --version Print the version of this program and exit - " - -for i in $@; do - case "$i" in - "-h" | "--help") - echo "${Usage}" - exit 0 - ;; - "-v" | "--version") - echo "dmount.sh v.${Version}" - exit 0 - ;; - esac -done - - - - - -MOUNTPOINT_cours=/home/primardj/cours -MOUNTPOINT_doc=/home/primardj/Documents -MOUNTPOINT_virt_machine=/home/primardj/virtual_machine -MOUNTPOINT_data=/home/primardj/data - - - - -remove_vgdevices() { - echo "force remove devices." >&2 - doas dmsetup info --columns - echo "removing all cryptdata volumes" >&2 - sleep 3 - array=(/dev/mapper/cryptdata-*) - for i in ${array[@]}; do - echo "$i" - doas dmsetup remove "$i" - done - doas dmsetup remove cryptdata -} - -echo locking device cryptdata -doas umount -R $MOUNTPOINT_cours -doas umount -R $MOUNTPOINT_doc -doas umount -R $MOUNTPOINT_virt_machine -doas umount -R $MOUNTPOINT_data - -doas lvchange -a n cryptdata || remove_vgdevices -doas cryptsetup close cryptdata