diff --git a/salt-keydiff.sh b/salt-keydiff.sh index b4de6a9..a6c66e0 100755 --- a/salt-keydiff.sh +++ b/salt-keydiff.sh @@ -13,6 +13,7 @@ set -Ceu minion="${1:-null}" +key_user="${2:-null}" NOCOLOR="$(tput sgr0)" if ! command -v jq >/dev/null || ! command -v salt-key >/dev/null @@ -35,8 +36,11 @@ then exit 2 fi -printf 'Enter fingerprint to diff against (run `salt-call --local key.finger` on the minion)\n' -read -r key_user +if [ "$key_user" = 'null' ] +then + printf 'Enter fingerprint to diff against (run `salt-call --local key.finger` on the minion)\n' + read -r key_user +fi if [ "$key_salt" = "$key_user" ] then