Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # A Simple Script to change the base URLs in a Magento MySQL Database when making a development mirror
- MUSER="$1"
- MPASS="$2"
- MDB="$3"
- DOMAIN="$4"
- # Detect paths
- MYSQL=$(which mysql)
- if [ $# -ne 4 ]
- then
- echo "Usage: $0 {MySQL-User-Name} {MySQL-User-Password} {MySQL-Database-Name} {New-Base-URL}"
- echo "Changes the Base URL in a Magento install to {New-Base-URL}"
- exit 1
- fi
- for $DOMAIN
- do
- echo "Changing Base URLs to $DOMAIN..."
- $MYSQL -u $MUSER -p$MPASS $MDB -e "update core_config_data set value = '$DOMAIN' where path = 'web/unsecure/base_url';"
- $MYSQL -u $MUSER -p$MPASS $MDB -e "update core_config_data set value = '$DOMAIN' where path = 'web/secure/base_url';"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement