Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Last active August 29, 2015 14:06
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 wokamoto/1758bb83c12368d13063 to your computer and use it in GitHub Desktop.
Save wokamoto/1758bb83c12368d13063 to your computer and use it in GitHub Desktop.
AWS で WordPress の URL を現在起動しているインスタンスに割り当てられた public hostname に置換する奴
#!/bin/bash
WP_ROOT="/path/to/wordpress"
WP_CLI="/usr/local/bin/wp --path=${WP_ROOT}"
_old_url=`${WP_CLI} eval "echo home_url();"`
_dns=`curl -s 169.254.169.254/latest/meta-data/public-hostname/`
$WP_CLI search-replace ${_old_url} http://${_dns}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment