21 lines
362 B
Bash
Executable file
21 lines
362 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
_LUKS=chome
|
|
_MOUNT=/home
|
|
|
|
# mount
|
|
if mountpoint -q ${_MOUNT}; then
|
|
sudo umount ${_MOUNT}
|
|
if mountpoint -q ${_MOUNT}; then
|
|
echo "umount failed"
|
|
exit 1
|
|
fi
|
|
fi
|
|
# LUKS
|
|
if [[ -e /dev/mapper/${_LUKS} ]]; then
|
|
sudo cryptsetup luksClose ${_LUKS}
|
|
if [[ -e /dev/mapper/${_LUKS} ]]; then
|
|
echo "luksClose failed"
|
|
exit 1
|
|
fi
|
|
fi
|