Created
February 8, 2013 04:52
-
-
Save 3100/4736664 to your computer and use it in GitHub Desktop.
Remove spam accounts from your MoinMoin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WHITELIST=./whitelist | |
WHITEUSER_FILES=$(cat $WHITELIST) | |
for USER_FILE in `ls *.*.*` | |
do | |
PATTERN='' | |
for ITEM in $WHITEUSER_FILES | |
do | |
if [ ${#PATTERN} -gt 0 ] ; then | |
PATTERN="${PATTERN}|${ITEM}" | |
else | |
PATTERN=$ITEM | |
fi | |
done | |
EMAIL=`cat $USER_FILE | grep email= | sed -e s/email=//g` | |
SAFE=`echo ${EMAIL} | egrep "$PATTERN"` | |
if [ -n "$SAFE" ] ; then | |
continue | |
fi | |
if [ ${#EMAIL} -gt 0 ] ; then | |
NAME= echo `cat $USER_FILE | grep ^name= | sed -e s/name=//g` | |
#echo $EMAIL && rm -i $USER_FILE | |
echo $EMAIL && rm $USER_FILE | |
fi | |
done | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
your_company.com | |
foo@some.org | |
bar@other.org |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment