diff options
Diffstat (limited to 'autoban.sh')
-rwxr-xr-x | autoban.sh | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -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)" |