delete old script dmount.sh and dumount.sh
This commit is contained in:
parent
e0db64fd7b
commit
065f7a9438
2 changed files with 0 additions and 90 deletions
31
dmount.sh
31
dmount.sh
|
@ -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
|
|
59
dumount.sh
59
dumount.sh
|
@ -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
|
|
Loading…
Reference in a new issue