daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Jun 4th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. DB_USER='******';
  4. DB_PASS='******';
  5.  
  6. echo 'USE portal' > query.sql
  7. mysql -u$DB_USER -p$DB_PASS < select.sql | grep -v user_login | sed 's/\t/#########/g' | while read str
  8. do
  9.     user_login=`echo $str | awk -F"#########" '{print $1}'`
  10.     user_email=`echo $str | awk -F"#########" '{print $2}'`
  11.     registered=`echo $str | awk -F"#########" '{print $3}'`
  12.     meta=`echo $str | awk -F"#########" '{print $4}'`
  13.     pass=`echo $meta | awk -F';' '{print $6}' | awk -F'"' '{print $2}'`
  14.     lname=`echo $meta | awk -F';' '{print $2}' | awk -F'"' '{print $2}'`
  15.     echo "INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_registered, display_name) VALUES ('$user_login', '$pass', '$user_login', '$user_email', '$registered', '$lname');" >> query.sql
  16. done
  17. echo 'UPDATE wp_signups SET active = 1' >> query.sql
  18. mysql -u$DB_USER -p$DB_PASS < query.sql
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top