5 echo "Usage: $0 <SMF database> <table prefix> <DB user> <password file>"
14 if [ "$(stat -c %A/%U ${dbpass})" != "-r--------/$(whoami)" ]
16 echo "Password file must have 400 permissions and must be owned by you! (And it must exist, by the way.)"
20 mysqlargs
="--user=${dbuser} --password=$(cat ${dbpass}) --database=${dbname} --default-character-set=utf8 --table"
29 /usr
/sbin
/mysqld
--version
35 echo Users awaiting approval
:
37 mysql
${mysqlargs} --execute="SELECT id_member, member_name, email_address, FROM_UNIXTIME(date_registered) FROM ${dbpref}_members WHERE is_activated=3 ORDER BY date_registered DESC;"
40 echo Approved users with zero posts
:
42 mysql
${mysqlargs} --execute="SELECT id_member, member_name, email_address, FROM_UNIXTIME(date_registered), FROM_UNIXTIME(last_login) FROM ${dbpref}_members WHERE is_activated=1 AND posts=0 ORDER BY date_registered"