summaryrefslogtreecommitdiff
path: root/audit_acl.sh
diff options
context:
space:
mode:
Diffstat (limited to 'audit_acl.sh')
-rwxr-xr-xaudit_acl.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/audit_acl.sh b/audit_acl.sh
new file mode 100755
index 0000000..e1bbce0
--- /dev/null
+++ b/audit_acl.sh
@@ -0,0 +1,17 @@
1#!/bin/bash
2#
3# Print out page names and their ACLS for all ACL'd pages
4#
5
6ROOT="$HOME/wiki-data/data/pages"
7
8for page in "$ROOT"/*; do
9 current_rev="$page/revisions/`cat $page/current 2>/dev/null`"
10 page_name=`basename "$page" | sed 's#(2f)#/#g'`
11 if [ -f "$current_rev" ]; then
12 output=`grep '#acl' "$current_rev"`
13 if [[ $? == 0 ]]; then
14 echo -e "\033[1;31m$page_name:\033[0m $output"
15 fi
16 fi
17done