From 385322f8deaab75c9663541255f6246c7a870e5d Mon Sep 17 00:00:00 2001 From: primardj Date: Mon, 22 Jan 2024 17:43:04 +0000 Subject: [PATCH] add version and parameter gestion to thoses two scripts. --- dmount.sh | 25 +++++++++++++++++++++++++ dumount.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/dmount.sh b/dmount.sh index 0920c7e..24e9d49 100755 --- a/dmount.sh +++ b/dmount.sh @@ -1,5 +1,30 @@ #/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 diff --git a/dumount.sh b/dumount.sh index 048920e..c682e1f 100755 --- a/dumount.sh +++ b/dumount.sh @@ -1,5 +1,33 @@ #/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