Skip to content

Commit

Permalink
Merge pull request #338 from nicksinger/dehydrated_filter
Browse files Browse the repository at this point in the history
Add dehydrated cron output filter script
  • Loading branch information
mergify[bot] authored Aug 7, 2024
2 parents a8daa4e + 9674513 commit d5d7166
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions filter-dehydrated-cron-output
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -euo pipefail
usage() {
cat << EOF
Usage: dehydrated --cron | $0 [OPTIONS]
Filter dehydrated cron output to only contain error messages as upstream suggested in
https://github.com/dehydrated-io/dehydrated/issues/47#issuecomment-221867853
Options:
-h, --help display this help
EOF
exit "$1"
}
main() {
opts=$(getopt -o h -l help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done
grep -v "^# INFO" | perl -0pe "s/Processing (.*)*\n \+ (.*)unchanged.\n \+ Checking .*\.\.\.\n \+ Valid till (.*) \(Longer than .* Skipping renew!//gm" | grep -v "^$"
}
caller 0 > /dev/null || main "$@"

0 comments on commit d5d7166

Please sign in to comment.