summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-02 12:26:24 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-02 12:26:24 -0400
commit3e06c6586453d5c592f3391d2ac0056c49568f86 (patch)
tree326ef20b07f089ab4f0f3b263e4423778534f518
parent01bccbc17309d454e1ab3e0a118d84ed9ccc79f3 (diff)
mv user-whitelist.rb show-user-whitelist.rb, have autoban.sh update files
-rwxr-xr-xautoban.sh27
-rwxr-xr-xshow-user-whitelist.rb (renamed from user-whitelist.rb)0
2 files changed, 20 insertions, 7 deletions
diff --git a/autoban.sh b/autoban.sh
index d234f25..137fa72 100755
--- a/autoban.sh
+++ b/autoban.sh
@@ -1,10 +1,23 @@
#!/bin/bash
-comm -13 <(sort user-whitelist.txt) <(
- < show-edit-counts.txt \
- grep -v 'blockreason:' |
- grep -v 'total_editcount: 0\b' |
- grep 'existing_editcount: 0\b' |
- cut -d $'\t' -f1 | cut -d ' ' -f2- |
- sort) |
+cached=false
+if [[ $1 == --cached ]]; then
+ cached=true
+fi
+
+for file in show-user-whitelist show-edit-counts; do
+ if [[ ! -f "${file}.txt" ]] || ! $cached; then
+ echo "Updating ${file}.txt"
+ ./${file}.rb > ${file}.txt
+ fi
+done
+
+comm -13 \
+ <(sort show-user-whitelist.txt) \
+ <(< show-edit-counts.txt \
+ grep -v 'blockreason:' |
+ grep -v 'total_editcount: 0\b' |
+ grep 'existing_editcount: 0\b' |
+ cut -d $'\t' -f1 | cut -d ' ' -f2- |
+ sort) |
./block-users.rb "Spammer (Autodetected: has made edits, but only to deleted pages)"
diff --git a/user-whitelist.rb b/show-user-whitelist.rb
index a9d3060..a9d3060 100755
--- a/user-whitelist.rb
+++ b/show-user-whitelist.rb