Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Filter out uninformative output lines from the ldap-sync cron job script | 3 # Filter out uninformative output lines from the ldap-sync cron job script |
4 | 4 |
5 last_updated="" | 5 last_action="" |
6 | 6 |
7 while read line; do | 7 while read line; do |
8 case "$line" in | 8 case "$line" in |
9 *Updating*|*Creating*) | 9 *-\>*) |
10 last_updated="$line" | 10 if [ ! -z "$last_action" ] |
11 then | |
12 echo "$last_action" | |
13 fi | |
14 | |
15 echo "$line" | |
16 last_action="" | |
11 ;; | 17 ;; |
12 *-\>*) | 18 --\ Found\ *\ users* | \ |
mathias
2018/06/05 14:32:19
Is there ever a case where we could encounter mult
| |
13 echo "$last_updated" | 19 \#* | \ |
14 echo "$line" | 20 *Synchronizing\ *\ groups* | \ |
15 ;; | 21 \*\*\ Synchronizing\ *\ users* | \ |
16 *Found* | \ | 22 --\ Updating\ user\ \'*\'?\(*\)* | \ |
17 *\#* | \ | 23 --\ Updating\ group\ \'*\'* | \ |
18 *Synchronizing*) | 24 --\ Creating\ user\ \'*\'?\(*\)* | \ |
19 continue | 25 --\ Creating\ group\ \'*\'*) |
26 last_action="$line" | |
20 ;; | 27 ;; |
21 *) | 28 *) |
22 echo "$line" | 29 echo "$line" |
23 ;; | 30 ;; |
24 esac | 31 esac |
25 done | 32 done |
LEFT | RIGHT |