Skip to content

Instantly share code, notes, and snippets.

@mgor
Last active October 30, 2015 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgor/4a76017aeddc16f9342d to your computer and use it in GitHub Desktop.
Save mgor/4a76017aeddc16f9342d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
cmd="mysql -u ${MYSQL_USER} --password=${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e"
table_prefix=$($cmd "show tables;" -N -B 2>/dev/null | tail -1 | awk -F\_ '{print $1}')
$cmd "update ${table_prefix}_options set option_value = 'http://localhost' where option_name in ('siteurl', 'home');" 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment