Mercurial > repos > other > usr-local-bin
view mount-crypt @ 22:faa17dcc2c95
Make a compromise when backing up to external HDD
Backups are getting bigger and space is getting short!
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 09 Jun 2019 15:52:35 +0100 |
parents | 14e726efe9b0 |
children |
line wrap: on
line source
#! /bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <filename>" >&2 exit 1 fi if [ ! -f "$1" ]; then echo "File doesn't exist" >&2 exit 2 fi LOOP_DEV=$(su -c "losetup --find --show \"$1\"") MAPPER=${LOOP_DEV##*/} su -c "cryptsetup luksOpen $LOOP_DEV $MAPPER && mkdir -p /media/$MAPPER && mount /dev/mapper/$MAPPER /media/$MAPPER"