diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2012-12-24 14:34:07 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2012-12-24 14:34:07 +0100 |
commit | b63e41b0f65cb561135ea39670d7763e2ae1a13f (patch) | |
tree | 23fc33eba0851e21b727ed2a27f43460032bb45c | |
parent | Per request of irate phone call with W3 Total Cache author, add version (diff) | |
download | w3-total-fail-b63e41b0f65cb561135ea39670d7763e2ae1a13f.tar.xz w3-total-fail-b63e41b0f65cb561135ea39670d7763e2ae1a13f.zip |
Default to most common prefix instead of empty one.
-rwxr-xr-x | w3-total-fail.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/w3-total-fail.sh b/w3-total-fail.sh index 6dfe857..ae56540 100755 --- a/w3-total-fail.sh +++ b/w3-total-fail.sh @@ -59,8 +59,10 @@ echo "forming HTTP requests. If not specified it will default to http://\$HOST" echo "Example: http://blog.zx2c4.com or https://someblahblasite.com/my_blog" echo echo "DBPREFIX is the wordpress prefix used for database table names. It" -echo "is often \"wp_\", but DBPREFIX defaults to an empty string if not" -echo "specified." +echo "is often \"wp_\", which DBPREFIX defaults to if this argument is" +echo "unspecified. Some wordpress installations will use an empty prefix," +echo "and others use a site-specific prefix. Most, however, will use the" +echo "default." echo "Example: wp_" echo printf "\033[0m" @@ -71,11 +73,9 @@ if [ $# -lt 1 ]; then fi host="$1" -urlbase="$2" -if [ -z "$urlbase" ]; then - urlbase="http://$host" -fi +urlbase="${2:-http://$host}" db_prefix="$3" +[ $# -lt 3 ] && db_prefix="wp_" for site_id in {1..25} 0; do for user_id in {1..25}; do query="SELECT * FROM ${db_prefix}users WHERE ID = '$user_id'" |