Last active
August 29, 2015 14:06
-
-
Save wokamoto/1758bb83c12368d13063 to your computer and use it in GitHub Desktop.
AWS で WordPress の URL を現在起動しているインスタンスに割り当てられた public hostname に置換する奴
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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