add version and parameter gestion to thoses two scripts.

This commit is contained in:
primardj 2024-01-22 17:43:04 +00:00
parent 5d323aed1b
commit 385322f8de
2 changed files with 53 additions and 0 deletions

View file

@ -1,5 +1,30 @@
#/bin/bash #/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" echo "unlocking device cryptdata"
doas rc-service dmcrypt restart doas rc-service dmcrypt restart
doas vgchange -a y cryptdata doas vgchange -a y cryptdata

View file

@ -1,5 +1,33 @@
#/bin/bash #/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_cours=/home/primardj/cours
MOUNTPOINT_doc=/home/primardj/Documents MOUNTPOINT_doc=/home/primardj/Documents
MOUNTPOINT_virt_machine=/home/primardj/virtual_machine MOUNTPOINT_virt_machine=/home/primardj/virtual_machine