style: fix typo, invalid hosts warning summary

This commit is contained in:
Asif Bacchus 2021-05-09 10:24:15 -06:00
parent b05192a613
commit 8801e55e30

View File

@ -209,42 +209,42 @@ textBlockSwitches() {
writeLog() { writeLog() {
case "$1" in case "$1" in
cf) cf)
printf "[%s] CF-ERR: %s (code: %s)\n" "$(stamp)" "$2" "$3" >>"$logFile" printf "[%s] CF-ERR: %s (code: %s)\n" "$(stamp)" "$2" "$3" >>"$logFile"
;; ;;
err) err)
printf "%s[%s] ERR: %s%s\n" "$err" "$(stamp)" "$2" "$norm" >>"$logFile" printf "%s[%s] ERR: %s%s\n" "$err" "$(stamp)" "$2" "$norm" >>"$logFile"
;; ;;
error) error)
printf "%s[%s] ERROR: %s (code: %s)%s\n" "$err" "$(stamp)" "$2" "$3" "$norm" >>"$logFile" printf "%s[%s] ERROR: %s (code: %s)%s\n" "$err" "$(stamp)" "$2" "$3" "$norm" >>"$logFile"
;; ;;
process) process)
printf "%s[%s] %s... %s" "$cyan" "$(stamp)" "$2" "$norm" >>"$logFile" printf "%s[%s] %s... %s" "$cyan" "$(stamp)" "$2" "$norm" >>"$logFile"
;; ;;
process-done) process-done)
printf "%s%s%s\n" "$cyan" "$2" "$norm" >>"$logFile" printf "%s%s%s\n" "$cyan" "$2" "$norm" >>"$logFile"
;; ;;
process-error) process-error)
printf "%sERROR%s\n" "$err" "$norm" >>"$logFile" printf "%sERROR%s\n" "$err" "$norm" >>"$logFile"
;; ;;
process-warning) process-warning)
printf "%s%s%s\n" "$warn" "$2" "$norm" >>"$logFile" printf "%s%s%s\n" "$warn" "$2" "$norm" >>"$logFile"
;; ;;
stamped) stamped)
printf "[%s] %s\n" "$(stamp)" "$2" >>"$logFile" printf "[%s] %s\n" "$(stamp)" "$2" >>"$logFile"
;; ;;
success) success)
printf "%s[%s] SUCCESS: %s%s\n" "$ok" "$(stamp)" "$2" "$norm" >>"$logFile" printf "%s[%s] SUCCESS: %s%s\n" "$ok" "$(stamp)" "$2" "$norm" >>"$logFile"
;; ;;
warn) warn)
printf "%s[%s] WARN: %s%s\n" "$warn" "$(stamp)" "$2" "$norm" >>"$logFile" printf "%s[%s] WARN: %s%s\n" "$warn" "$(stamp)" "$2" "$norm" >>"$logFile"
;; ;;
warning) warning)
printf "%s[%s] WARNING: %s%s\n" "$warn" "$(stamp)" "$2" "$norm" >>"$logFile" printf "%s[%s] WARNING: %s%s\n" "$warn" "$(stamp)" "$2" "$norm" >>"$logFile"
;; ;;
*) *)
printf "%s\n" "$2" >>"$logFile" printf "%s\n" "$2" >>"$logFile"
;; ;;
esac esac
} }
@ -530,7 +530,7 @@ done
# exit # exit
if [ "$invalidDomainCount" -ne 0 ]; then if [ "$invalidDomainCount" -ne 0 ]; then
writeLog warning "${invalidDomainCount} invalid host(s) were supplied for updating." writeLog warning "${invalidDomainCount} invalid host(s) supplied for updating."
fi fi
if [ "$failedHostCount" -ne 0 ]; then if [ "$failedHostCount" -ne 0 ]; then
exitError 26 exitError 26