Created
February 1, 2014 20:19
-
-
Save ohhdemgirls/8758179 to your computer and use it in GitHub Desktop.
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/sh | |
# Quickly delete all traces of a user from the database and filesystem | |
# usage: ./deluser.sh username | |
USER=$1 | |
USERID=`sqlite3 ../database.db "select id from users where username = '${USER}'"` | |
for table in albums comments images posts; do | |
sqlite3 ../database.db "delete from ${table} where userid = ${USERID}" | |
done | |
sqlite3 ../database.db "delete from users where id = ${USERID}" | |
rm -r ../content/${USER}/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment