Add test condition when there are no errors
Also log unjoinable instances
This commit is contained in:
parent
90f231e59f
commit
d5c632e74f
1 changed files with 60 additions and 44 deletions
20
tootpaste.sh
20
tootpaste.sh
|
@ -40,6 +40,7 @@ accounts_cull() {
|
||||||
|
|
||||||
# Remove instances that have an expired certificate from more than
|
# Remove instances that have an expired certificate from more than
|
||||||
# TLS_EXPIRED_MAX_SEC
|
# TLS_EXPIRED_MAX_SEC
|
||||||
|
if grep -q 'certificate has expired' "$CULL_LOG"; then
|
||||||
grep 'certificate has expired' "$CULL_LOG" \
|
grep 'certificate has expired' "$CULL_LOG" \
|
||||||
| awk '{print $NF}' \
|
| awk '{print $NF}' \
|
||||||
| cut -d'/' -f3 \
|
| cut -d'/' -f3 \
|
||||||
|
@ -73,19 +74,34 @@ accounts_cull() {
|
||||||
"$instance"
|
"$instance"
|
||||||
fi
|
fi
|
||||||
done < "$TLS_EXPIRED_LOG"
|
done < "$TLS_EXPIRED_LOG"
|
||||||
|
fi
|
||||||
|
|
||||||
# Log other instances errors, then if they were already in the log, purge
|
# Log other instances errors, then if they were already in the log, purge them
|
||||||
# them
|
if grep -q 'https' "$CULL_LOG"; then
|
||||||
grep \
|
grep \
|
||||||
-e 'certificate verify failed' \
|
-e 'certificate verify failed' \
|
||||||
-e 'timed out' \
|
-e 'timed out' \
|
||||||
-e 'sslv3 alert handshake failure' \
|
-e 'sslv3 alert handshake failure' \
|
||||||
-e 'TooManyRedirectsError' \
|
-e 'TooManyRedirectsError' \
|
||||||
|
-e 'EndlessRedirectError' \
|
||||||
|
-e 'HostValidationError' \
|
||||||
"$CULL_LOG" \
|
"$CULL_LOG" \
|
||||||
| awk '{print $NF}' \
|
| awk '{print $NF}' \
|
||||||
| cut -d'/' -f3 \
|
| cut -d'/' -f3 \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
> "$OTHER_ERRORS_LOG"
|
> "$OTHER_ERRORS_LOG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Log unjoinable instances, then if they were already in the log, purge them
|
||||||
|
if grep -q 'not available during the check:' "$CULL_LOG"; then
|
||||||
|
grep \
|
||||||
|
-A 9999 \
|
||||||
|
'not available during the check:' \
|
||||||
|
"$CULL_LOG" \
|
||||||
|
| tail -n +2 \
|
||||||
|
| sed -E 's/\s+//' \
|
||||||
|
> "$OTHER_ERRORS_LOG"
|
||||||
|
fi
|
||||||
|
|
||||||
test -f $PREV_ERRORS_LOG || touch $PREV_ERRORS_LOG
|
test -f $PREV_ERRORS_LOG || touch $PREV_ERRORS_LOG
|
||||||
while read -r instance; do
|
while read -r instance; do
|
||||||
|
|
Loading…
Add table
Reference in a new issue