forked from LibertaCasa/salt-keydiff
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
|
set -Ceu
|
||||||
|
|
||||||
minion="${1:-null}"
|
minion="${1:-null}"
|
||||||
|
key_user="${2:-null}"
|
||||||
NOCOLOR="$(tput sgr0)"
|
NOCOLOR="$(tput sgr0)"
|
||||||
|
|
||||||
if ! command -v jq >/dev/null || ! command -v salt-key >/dev/null
|
if ! command -v jq >/dev/null || ! command -v salt-key >/dev/null
|
||||||
@ -35,8 +36,11 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf 'Enter fingerprint to diff against (run `salt-call --local key.finger` on the minion)\n'
|
if [ "$key_user" = 'null' ]
|
||||||
read -r key_user
|
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" ]
|
if [ "$key_salt" = "$key_user" ]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user