1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-04 00:17:06 +00:00
mailinabox/ehdd/ehdd_funcs.sh
downtownallday 38d0bcff22 Add support for non-interactive install
Centralize all scripts into 'ehdd'
2020-06-22 10:03:21 -04:00

27 lines
467 B
Bash

if [ -s /etc/mailinabox.conf ]; then
source /etc/mailinabox.conf
[ $? -eq 0 ] || exit 1
else
STORAGE_ROOT="/home/${STORAGE_USER:-user-data}"
fi
EHDD_IMG="$STORAGE_ROOT.HDD"
EHDD_MOUNTPOINT="$STORAGE_ROOT"
EHDD_LUKS_NAME="c1"
find_unused_loop() {
losetup -f
}
find_inuse_loop() {
losetup -l | awk "\$6 == \"$EHDD_IMG\" { print \$1 }"
}
keyfile_option() {
if [ ! -z "$EHDD_KEYFILE" ]; then
echo "--key-file $EHDD_KEYFILE"
fi
}