11#! /usr/bin/env bash
22
33USAGE=" USAGE:
4- setup_secure_dump [OPTIONS]
4+ setup-secure-dump [OPTIONS]
55
66 Options:
77 -m, --mount mountpoint The directory to mount the container to
@@ -13,10 +13,32 @@ USAGE="USAGE:
1313 -h, --help Print this help message"
1414
1515. " $( dirname $BASH_SOURCE ) /lib/parse_args.sh"
16- KEYWORDS=(" -m" " --mount" " -c" " --container" " -d;bool" " --delete;bool" " -s" " --size" )
16+ KEYWORDS=(" -m" " --mount" " -c" " --container" " -d;bool" " --delete;bool" " -s" " --size" " --i-really-want-to;bool " )
1717parse_args __USAGE " $USAGE " " $@ "
1818set_trap 1 2
1919
20+ if [[ " ${KW_ARGS['--i-really-want-to']} " != ' true' ]]
21+ then
22+ echo " !!! DEPRECATION WARNING !!!"
23+ echo " Since writing this script, I have found a (actually 2) way better and easier solution for the problem it tries to solve."
24+ echo " Please, check out either https://www.cryfs.org/ or https://nuetzlich.net/gocryptfs/"
25+ echo " These tools are easy to use and it shouldn't be hard to use them with a random key."
26+ echo " "
27+ echo " For example, in order to do basically the same thing as this script with cryfs, just add the following code to your ~/.bashrc:
28+ if ! mountpoint -q -- " ~/secure_dump"
29+ then
30+ [ -d ~/.secure_dump_enc ] && rm -r ~/.secure_dump_enc ~/secure_dump
31+ mkdir -p ~/.secure_dump_enc ~/.secure_dump
32+ head -c 10 /dev/urandom | base64 | CRYFS_FRONTEND=noninteractive cryfs --allow-replaced-filesystem ~/.secure_dump_enc ~/secure_dump
33+ fi
34+ "
35+ echo " "
36+ echo " Maybe I'll migrate the setup-secure-dump script rely on them at some point :)"
37+ echo " "
38+ echo " If you really insist on using this script, pass the parameter --i-really-want-to"
39+ exit 0
40+ fi
41+
2042MOUNT_POINT=" ${KW_ARGS['-m']-$HOME / secure_dump} "
2143MOUNT_POINT=" ${KW_ARGS['--mountpoint']-$MOUNT_POINT } "
2244CONTAINER=" ${KW_ARGS['-c']-$HOME / secure_dump.img} "
0 commit comments