Advertisement
Guest User

Untitled

a guest
Sep 13th, 2015
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #!/bin/bash
  2. # A Simple Script to change the base URLs in a Magento MySQL Database when making a development mirror
  3. MUSER="$1"
  4. MPASS="$2"
  5. MDB="$3"
  6. DOMAIN="$4"
  7.  
  8. # Detect paths
  9. MYSQL=$(which mysql)
  10.  
  11. if [ $# -ne 4 ]
  12. then
  13. echo "Usage: $0 {MySQL-User-Name} {MySQL-User-Password} {MySQL-Database-Name} {New-Base-URL}"
  14. echo "Changes the Base URL in a Magento install to {New-Base-URL}"
  15. exit 1
  16. fi
  17.  
  18. for $DOMAIN
  19.  
  20. do
  21. echo "Changing Base URLs to $DOMAIN..."
  22. $MYSQL -u $MUSER -p$MPASS $MDB -e "update core_config_data set value = '$DOMAIN' where path = 'web/unsecure/base_url';"
  23. $MYSQL -u $MUSER -p$MPASS $MDB -e "update core_config_data set value = '$DOMAIN' where path = 'web/secure/base_url';"
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement