VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Linux/mount.veracrypt
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2021-08-21 22:33:39 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2021-08-21 22:36:48 +0200
commit7df5a58adc83702b40ec58a435e9c5e1b6062e26 (patch)
treea9fecd3a53dcef60171839630dfc0e04072474a9 /src/Setup/Linux/mount.veracrypt
parent49a125230654d0a388718cfd43ded546a1d7e5f5 (diff)
downloadVeraCrypt-7df5a58adc83702b40ec58a435e9c5e1b6062e26.tar.gz
VeraCrypt-7df5a58adc83702b40ec58a435e9c5e1b6062e26.zip
Linux: Better Linux desktop integration. Add mount.veracrypt script for fstab (proposed by unit193 at https://github.com/veracrypt/VeraCrypt/issues/814)
Diffstat (limited to 'src/Setup/Linux/mount.veracrypt')
-rw-r--r--src/Setup/Linux/mount.veracrypt23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Setup/Linux/mount.veracrypt b/src/Setup/Linux/mount.veracrypt
new file mode 100644
index 00000000..499ad9b9
--- /dev/null
+++ b/src/Setup/Linux/mount.veracrypt
@@ -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}