From f287ecedc78c0cc8fb485c5995b8d1cfae9f0fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 20 Sep 2017 21:19:05 +0200 Subject: Commit current state --- scripts/encrypt_file.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/encrypt_file.sh (limited to 'scripts/encrypt_file.sh') diff --git a/scripts/encrypt_file.sh b/scripts/encrypt_file.sh new file mode 100755 index 0000000..cee8c86 --- /dev/null +++ b/scripts/encrypt_file.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +F="$(readlink -f "$1")" + +cd "$(dirname "$0")/.." + +TMP="$(mktemp)" +KEY="$(gpg2 --decrypt files/keys/primary.gpg)" + +PASS_ENC="$KEY" openssl aes-192-cbc -e -a -pass env:PASS_ENC -in "$F" -out "$TMP" +mv "$TMP" "$F" -- cgit v1.2.3