diff options
author | Michal Wojdyla | 2020-10-28 19:31:20 +0100 |
---|---|---|
committer | Michal Wojdyla | 2020-10-28 19:31:20 +0100 |
commit | 0d9d81bf08870aa539014d67226258d388b3fb0d (patch) | |
tree | e9a8f69dce998d562dd5ea19dca205947e6574ab /truecrypt-mount.sh | |
parent | c2352d28730d42cd77faa6e74b074179201c6f91 (diff) | |
download | aur-truecrypt-mount.tar.gz |
update to newest version from wiki
Diffstat (limited to 'truecrypt-mount.sh')
-rw-r--r-- | truecrypt-mount.sh | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/truecrypt-mount.sh b/truecrypt-mount.sh index 9d40ecde7d9b..7a90ba85b4b1 100644 --- a/truecrypt-mount.sh +++ b/truecrypt-mount.sh @@ -1,18 +1,21 @@ -#!/usr/bin/env sh +#!/bin/sh DEV="$1" MNTPT="$2" OPTIONS="" TCOPTIONS="" + shift 3 IFS=',' for arg in $*; do - if [ "${arg}" == "system" ]; then - TCOPTIONS="${TCOPTIONS}-m=system " - elif [[ "${arg}" == fs=* ]]; then - FS=${arg#*=} - TCOPTIONS="${TCOPTIONS}--filesystem=${FS} " - else - OPTIONS="${OPTIONS}${arg}," - fi + case "$arg" in + system) TCOPTIONS=(${TCOPTIONS[*]} --m=system);; + fs*) TCOPTIONS=(${TCOPTIONS[*]} --filesystem=${arg#*=});; + keyfiles*) TCOPTIONS=(${TCOPTIONS[*]} --keyfiles=${arg#*=});; + password*) TCOPTIONS=(${TCOPTIONS[*]} --password=${arg#*=}) && echo "password triggered" ;; + protect-hidden*) TCOPTIONS=(${TCOPTIONS[*]} --protect-hidden=${arg#*=});; + *) OPTIONS="${OPTIONS}${arg},";; + + esac done -exec truecrypt ${DEV} ${MNTPT} ${TCOPTIONS% *} --fs-options="${OPTIONS%,*}" + +/bin/truecrypt --text --non-interactive ${DEV} ${MNTPT} ${TCOPTIONS[*]} --fs-options="${OPTIONS%,*}" |