diff options
author | root <root@vps-18a7a2b7.vps.ovh.ca> | 2023-05-24 16:39:59 -0400 |
---|---|---|
committer | root <root@vps-18a7a2b7.vps.ovh.ca> | 2023-05-24 16:40:26 -0400 |
commit | 53870be8b0eece765e941e8851e9109dd135ef26 (patch) | |
tree | 5d008518fa4dec32f512873eca0393ec820b24c7 | |
parent | af2d8a50ad8ecc20dfed8cc1948e9ebd785b023e (diff) |
wordpress-mysql: use remote mysql to check db existence
-rwxr-xr-x | wordpress/wordpress-mysql | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wordpress/wordpress-mysql b/wordpress/wordpress-mysql index 6a56bbb..a9b0d21 100755 --- a/wordpress/wordpress-mysql +++ b/wordpress/wordpress-mysql | |||
@@ -8,7 +8,15 @@ read_config() | |||
8 | 8 | ||
9 | have_database() | 9 | have_database() |
10 | { | 10 | { |
11 | mysql -ss -e "show databases where \`database\` = '${db_name//\'/\'\'}'" | (read match && [ "$match" ]) | 11 | if [ "$DO_NOT_USE_SSH" ] |
12 | then | ||
13 | set -- mysql --host="$db_host" | ||
14 | else | ||
15 | set -- ssh "$db_host" -- mysql | ||
16 | fi | ||
17 | "$@" -ss <<END | (read match && [ "$match" ]) | ||
18 | show databases where \`database\` = '${db_name//\'/\'\'}' | ||
19 | END | ||
12 | } | 20 | } |
13 | 21 | ||
14 | create_new_mysql_database() | 22 | create_new_mysql_database() |