daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Sep 13th, 2015 127 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
Top