From d196bbb00bd183b6af774b47527e10d4b807a827 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Fri, 3 Mar 2023 19:20:00 +0100 Subject: [PATCH] bin: add `lock`, a VERY simple encryption tool --- bin/lock | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/lock diff --git a/bin/lock b/bin/lock new file mode 100755 index 0000000..b64657d --- /dev/null +++ b/bin/lock @@ -0,0 +1,19 @@ +#!/bin/sh +[ -t 2 ] && { red=$(printf "\033[31m"); sgr0=$(printf "\033[0m"); } + +error() { + echo "${red}ERROR:${sgr0} ${1}" >&2; + exit 1 +} + +[ -n "$1" ] || error "input file missing" +[ -r "$1" ] || error "can't read input file" + +printf '#!/bin/sh +GPG_TTY=$(tty) +export GPG_TTY +base64 -d <