summarylogtreecommitdiffstats
path: root/truecrypt-mount.sh
diff options
context:
space:
mode:
authorMichal Wojdyla2020-10-28 19:31:20 +0100
committerMichal Wojdyla2020-10-28 19:31:20 +0100
commit0d9d81bf08870aa539014d67226258d388b3fb0d (patch)
treee9a8f69dce998d562dd5ea19dca205947e6574ab /truecrypt-mount.sh
parentc2352d28730d42cd77faa6e74b074179201c6f91 (diff)
downloadaur-truecrypt-mount.tar.gz
update to newest version from wiki
Diffstat (limited to 'truecrypt-mount.sh')
-rw-r--r--truecrypt-mount.sh23
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%,*}"