Commit 3678d388 authored by Michael Völske's avatar Michael Völske

update authorized-ssh-keys

parent 6de8cdbc
...@@ -46,13 +46,18 @@ main() { ...@@ -46,13 +46,18 @@ main() {
| sort -t: -k2 -k1V \ | sort -t: -k2 -k1V \
> $LIST > $LIST
while IFS=":" read -r -a KEYHOST ; do while IFS=":" read -r -a LINE ; do
K=${KEYHOST[1]} H=${LINE[0]}
H=${KEYHOST[0]} K=${LINE[1]}
if [[ $K =~ "did not return" ]]; then if [[ $K =~ "did not return" ]]; then
NUM_DEAD=$(( NUM_DEAD + 1)) NUM_DEAD=$(( NUM_DEAD + 1))
elif [[ $K != $LASTKEY && $K != "" ]]; then continue
fi
if [[ $K =~ ^[\ \t]*$ ]]; then K=""; fi
if [[ $K != $LASTKEY && $K != "" ]]; then
echo Key: $K echo Key: $K
echo Used on hosts: echo Used on hosts:
KEYCOUNT=$(( $KEYCOUNT + 1 )) KEYCOUNT=$(( $KEYCOUNT + 1 ))
...@@ -68,7 +73,7 @@ main() { ...@@ -68,7 +73,7 @@ main() {
LASTKEY=$K LASTKEY=$K
done < $LIST done < $LIST
rm -f $LIST rm -f $LIST
echo "TOTAL UNIQUE KEYS: $KEYCOUNT across ${#KPH[@]} / $(( $NUM_DEAD + ${#KPH[@]} )) online hosts." echo "TOTAL UNIQUE KEYS: $KEYCOUNT; $NUM_DEAD hosts offline; ${#KPH[@]} hosts online."
} }
# #
# Start programm with parameters. # Start programm with parameters.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment