From 37f740fd178002c6f74ef42485e4d12840bc4b77 Mon Sep 17 00:00:00 2001 From: Olav Reinert Date: Apr 08 2021 19:17:38 +0000 Subject: encrypt_pillar.sh: prompt for secret on stderr This allows for redirecting the output of bin/encrypt_pillar.sh to a file while still showing prompts and error messages in the terminal. Also removed Karol Babioch's expired key, because it prevents encrypting pillar data, and because he's no longer with SUSE. --- diff --git a/bin/encrypt_pillar.sh b/bin/encrypt_pillar.sh index f9066f3..164be06 100755 --- a/bin/encrypt_pillar.sh +++ b/bin/encrypt_pillar.sh @@ -20,14 +20,14 @@ while getopts mh arg; do done if [[ -n $MULTILINE ]]; then - echo "Please type the lines that you want to encrypt, and press CTRL+D when done" + echo "Please type the lines that you want to encrypt, and press CTRL+D when done:" >/dev/stderr STRING=$(cat) else - echo "Please type the string that you want to encrypt" + echo "Please type the string that you want to encrypt:" >/dev/stderr read STRING fi -[[ -z $STRING ]] && echo "ERROR: Input was empty" && exit 1 +[[ -z $STRING ]] && echo "ERROR: Input was empty" >/dev/stderr && exit 1 RECIPIENTS=$(egrep '^\s*0x' encrypted_pillar_recipients | while read i; do echo "-r $i"; done | xargs) echo -n "${STRING}" | gpg --armor --batch --trust-model always --encrypt ${RECIPIENTS} diff --git a/encrypted_pillar_recipients b/encrypted_pillar_recipients index 87b149d..5c45b8e 100644 --- a/encrypted_pillar_recipients +++ b/encrypted_pillar_recipients @@ -6,8 +6,6 @@ 0xCE054B2AF62B7584 # Martin Caj 0x2E77A13011F5D3C2 -# Karol Babioch -0xDF49418F6267267B # Ricardo Klein 0xC1B58F3E048F6BC7