Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: edit.sh

Issue 29761555: #8852 - ldap sync output filter (Closed)
Patch Set: #8852 - ldap sync output filter Created June 12, 2018, 2:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | output.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: edit.sh
diff --git a/edit.sh b/edit.sh
new file mode 100755
index 0000000000000000000000000000000000000000..ab243baa9ad97cf7c3af71f83dfbfba0810bd1b7
--- /dev/null
+++ b/edit.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Filter out uninformative output lines from the ldap-sync cron job script
+
+last_action=""
+
+while read line; do
+ case "$line" in
+ *-\>*)
+ case "$last_action" in
mathias 2018/06/19 13:12:39 As discussed, please replace the inner `case` stat
+ *-\>*)
+ echo "$line"
+ ;;
+ *)
+ echo "$last_action"
+ echo "$line"
+ last_action="$line"
+ ;;
+ esac
+ ;;
+ *Found*users* | \
mathias 2018/06/19 13:12:40 How about `"* Found * users *"`?
+ *\#* | \
+ *Synchronizing*groups* | \
+ *Synchronizing*users* | \
+ *Updating?user?\'*\'?\(*\)* | \
+ *Updating?group?\'*\'* | \
+ *Creating?user?\'*\'?\(*\)* | \
+ *Creating?group?\'*\'*)
+ last_action="$line"
+ continue
mathias 2018/06/19 13:12:39 Not: The `continue` statement is not exactly neces
+ ;;
+ *)
+ echo "$line"
+ ;;
+ esac
+done
« no previous file with comments | « no previous file | output.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld