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

update authorized-ssh-keys

parent 6de8cdbc
......@@ -46,13 +46,18 @@ main() {
| sort -t: -k2 -k1V \
> $LIST
while IFS=":" read -r -a KEYHOST ; do
K=${KEYHOST[1]}
H=${KEYHOST[0]}
while IFS=":" read -r -a LINE ; do
H=${LINE[0]}
K=${LINE[1]}
if [[ $K =~ "did not return" ]]; then
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 Used on hosts:
KEYCOUNT=$(( $KEYCOUNT + 1 ))
......@@ -68,7 +73,7 @@ main() {
LASTKEY=$K
done < $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.
......
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