From 835b994969c90a3caa40bc43fae8d71e1bfbca56 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Tue, 29 Mar 2022 15:33:22 -0500 Subject: refactor: moved scripts out of $HOME --- scripts/.local/bin/gpg-test.sh | 102 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 scripts/.local/bin/gpg-test.sh (limited to 'scripts/.local/bin/gpg-test.sh') diff --git a/scripts/.local/bin/gpg-test.sh b/scripts/.local/bin/gpg-test.sh new file mode 100644 index 0000000..f23b83d --- /dev/null +++ b/scripts/.local/bin/gpg-test.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash + +TEMP=$(getopt -o hvdsea: --long help,verbose,debug,signature,encryption,authentication \ + -n 'javawrap' -- "$@") + +if [ $? != 0 ]; then + echo "Terminating..." >&2 + exit 1 +fi + +eval set -- "$TEMP" + +usage() { + cat <$temp/test.txt + + result="$(gpg --output $temp/test.gpg -e $temp/test.txt 2>&1 && gpg --output $temp/test.out -d $temp/test.txt.gpg 2>&1)" + grep '42' $temp/test.out 2>&1 + print_result result +fi + +if [[ $ALL -eq "true" || $AUTHENTICATION -eq "true" ]]; then + echo "Testing authentication key..." + result="$(ssh-add -l)" + print_result result +fi -- cgit v1.2.3-70-g09d2