From 9a075498d75cd5f594631341a64e3c12acc00036 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Oct 31 2017 15:27:59 +0000 Subject: bin/encrypt_pillar.sh: read the string from the input instead of passing it from an argument, so that we don't have passwords on our shell history --- diff --git a/bin/encrypt_pillar.sh b/bin/encrypt_pillar.sh index e002613..35d0d84 100755 --- a/bin/encrypt_pillar.sh +++ b/bin/encrypt_pillar.sh @@ -4,21 +4,20 @@ help() { echo "Encrypt a given string and print out the output. This output can be" echo "then used as encrypted pillar" echo - echo "Arguments:" - echo "-s STRING The string to encrypt" - echo } [[ $1 == '--help' ]] && help && exit while getopts s:v:h arg; do case ${arg} in - s) STRING=${OPTARG} ;; h) help && exit ;; *) help && exit 1 ;; esac done +echo "Please type the string that you want to encrypt" +read STRING + [[ -z $STRING ]] && help && exit 1 RECIPIENTS=$(egrep '^\s*0x' encrypted_pillar_recipients | while read i; do echo "-r $i"; done | xargs)