Allow fingerprint as argument
Fingerprint can optionally be passed as the second command line argument. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
parent
db343e31ce
commit
a2dc671441
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user