Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- sites=`ls -l /home/shnize78/public_html|awk '{print $9}'`
- num=1
- for site in $sites; do
- if [ -e "/home/shnize78/public_html/$site/wp-config.php" ]; then
- name=`grep -i "DB_NAME" /home/shnize78/public_html/$site/wp-config.php | awk -F',' '{print $2}' | awk -F')' '{print $1}' | awk -F"'" '{print $2}'`
- pass=`grep -i "DB_PASSWORD" /home/shnize78/public_html/$site/wp-config.php | awk -F',' '{print $2}' | awk -F')' '{print $1}' | awk -F"'" '{print $2}'`
- user=`grep -i "DB_USER" /home/shnize78/public_html/$site/wp-config.php | awk -F',' '{print $2}' | awk -F')' '{print $1}' | awk -F"'" '{print $2}'`
- MYSQL=`mysqladmin -u$user -p$pass status 1> /dev/null 2> /dev/null`
- if [ "$?" -ne "0" ]; then
- echo "[-] $site MySQL Login Failed"
- # Step 1, create the database and allow the blog user access
- # Blog user's pass: $L,V?MRzylB8
- #mysql -e "create database shnize78_blog${num} character set utf8;"
- #mysql -e "GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , REFERENCES , INDEX , ALTER , CREATE TEMPORARY TABLES , LOCK TABLES , EXECUTE on shnize78_blog${num} . * to 'shnize78_blog'@'localhost'"
- # Step 2, Clean out the existing folders
- #mv /home/shnize78/public_html/$site /home/shnize78/public_html/${site}.backup
- #mkdir /home/shnize78/public_html/$site
- # Step 3, Get the right directory
- site1=`echo $site | awk -F'.' '{print $1}'`
- site2=`echo $site | awk -F'.' '{print $2}'`
- site=${site1}.${site2}
- #echo $site
- # Step 4, Untar the new install
- #tar -xzf /home/shnize78/latest.tar.gz -C /home/shnize78/public_html/$site/
- # Step 5, Move the new wordpress into the proper directory
- #mv /home/shnize78/public_html/$site/wordpress/* /home/shnize78/public_html/$site/
- # Step 6, Install in browser..
- # Increment the ID
- num=$(($num+1))
- fi
- fi
- done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement