diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2021-02-20 09:19:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2021-02-20 09:19:38 -0300 |
commit | 45bce1a2158a0a9c82bca06aa364adda03e07e0c (patch) | |
tree | 318fa6015f9031d5c43761390f269d9a0d4bb485 /tombopen | |
parent | 85ef0c76775ec400794cb0daeb97b4d38118a6c2 (diff) | |
download | scripts-45bce1a2158a0a9c82bca06aa364adda03e07e0c.tar.gz scripts-45bce1a2158a0a9c82bca06aa364adda03e07e0c.tar.bz2 |
Feat: adds tombopen
Diffstat (limited to 'tombopen')
-rwxr-xr-x | tombopen | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tombopen b/tombopen new file mode 100755 index 0000000..33aa1e7 --- /dev/null +++ b/tombopen @@ -0,0 +1,26 @@ +#/usr/bin/env bash +# +# Open a Tomb. +# + +# Parameters +BASENAME="`basename $0`" +TOMB="$1" +TOMBS="$HOME/data/tombs" +KEYS="$HOME/.tombs" + +# Check +if [ ! -d "$TOMBS" ]; then + echo "error: no cemetery available at $TOMBS" + exit 1 +elif [ -z "$TOMB" ]; then + echo "usage: $BASENAME <tomb>" + echo "available tombs: `ls $TOMBS | xargs basename -a -s .tomb | xargs echo`" + exit 1 +elif [ ! -e "$KEYS/$TOMB.tomb.key" ]; then + echo "missing keyfile $KEYS/$TOMB.tomb.key" + exit 1 +fi + +# Dispatch +tomb open $TOMBS/$TOMB.tomb -k $KEYS/$TOMB.tomb.key |