Last active
February 10, 2016 18:14
-
-
Save 8ig8/1fcdee3dddcd840083f2 to your computer and use it in GitHub Desktop.
Parse DB details from wp-config.php
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 | |
## | |
# Parse wp-config.php | |
# | |
# https://gist.github.com/8ig8/1fcdee3dddcd840083f2 | |
# curl https://gist.githubusercontent.com/8ig8/1fcdee3dddcd840083f2/raw/parse-wp-config.sh | bash | |
# curl -k https://gist.githubusercontent.com/8ig8/1fcdee3dddcd840083f2/raw/parse-wp-config.sh | bash | |
WPDBNAME="$(cat ./wp-config.php | grep DB_NAME | cut -d \' -f 4)" | |
WPDBUSER="$(cat ./wp-config.php | grep DB_USER | cut -d \' -f 4)" | |
WPDBPASS="$(cat ./wp-config.php | grep DB_PASSWORD | cut -d \' -f 4)" | |
WPDBHOST="$(cat ./wp-config.php | grep DB_HOST | cut -d \' -f 4)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment