1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 11:28:26 -06:00

Linux: Better Linux desktop integration. Add mount.veracrypt script for fstab (proposed by unit193 at https://github.com/veracrypt/VeraCrypt/issues/814)

This commit is contained in:
Mounir IDRASSI
2021-08-21 22:33:39 +02:00
parent 49a1252306
commit 7df5a58adc
4 changed files with 43 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
#!/bin/bash
DEV="$1"
MNTPT="$2"
VCOPTIONS=""
OPTIONS=""
shift 3
IFS=','
for arg in $*; do
case "$arg" in
truecrypt) VCOPTIONS=(${VCOPTIONS[*]} --truecrypt);;
system) VCOPTIONS=(${VCOPTIONS[*]} --mount-options=system);;
fs=*) VCOPTIONS=(${VCOPTIONS[*]} --filesystem=${arg#*=});;
keyfiles=*) VCOPTIONS=(${VCOPTIONS[*]} --keyfiles=${arg#*=});;
password=*) VCOPTIONS=(${VCOPTIONS[*]} --password=${arg#*=});;
pim=*) VCOPTIONS=(${VCOPTIONS[*]} --pim==${arg#*=});;
protect-hidden=*) VCOPTIONS=(${VCOPTIONS[*]} --protect-hidden=${arg#*=});;
slot=*) VCOPTIONS=(${VCOPTIONS[*]} --slot=${arg#*=});;
*) OPTIONS="${OPTIONS}${arg},";;
esac
done
/usr/bin/veracrypt --non-interactive --text ${VCOPTIONS[*]} --fs-options="${OPTIONS%,*}" ${DEV} ${MNTPT}