summaryrefslogtreecommitdiff
path: root/audit_acl.sh
blob: e1bbce07cf97aacb54974b11dd67226857ee564c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
#
# Print out page names and their ACLS for all ACL'd pages
#

ROOT="$HOME/wiki-data/data/pages"

for page in "$ROOT"/*; do
    current_rev="$page/revisions/`cat $page/current 2>/dev/null`"
    page_name=`basename "$page" | sed 's#(2f)#/#g'`
    if [ -f "$current_rev" ]; then
        output=`grep '#acl' "$current_rev"`
        if [[ $? == 0 ]]; then
            echo -e "\033[1;31m$page_name:\033[0m $output"
        fi
    fi
done