summaryrefslogtreecommitdiff
path: root/veracrypt/debian/scripts/mount.veracrypt
blob: 499ad9b9bf62c05aa7fe8d5b399461e3b92644ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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}
bgstack15