From 1dc2a6951a51d6c958d9ac8ee3b1bb605c925f36 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sun, 22 Apr 2018 20:41:30 +0200 Subject: [PATCH] Add check for MariaDB status in Ushahidi update-url.sh --- ushahidi/srv/ushahidi/update-url.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ushahidi/srv/ushahidi/update-url.sh b/ushahidi/srv/ushahidi/update-url.sh index 11df8e4..261b8ff 100755 --- a/ushahidi/srv/ushahidi/update-url.sh +++ b/ushahidi/srv/ushahidi/update-url.sh @@ -5,5 +5,12 @@ HOST="${1}" sed -i "s|^ \"backend_url\".*| \"backend_url\": \"https://${HOST}/platform\",|" /srv/ushahidi/conf/config.json +if [ ! -e /run/openrc/started/mariadb ]; then + service mariadb start + STOP_MARIADB=1 +fi API_URL='\\\"https:\\\\/\\\\/'${HOST}'\\\\/platform\\\\/api\\\\/v3\\\\/config\\\\/data-provider\\\"' echo 'UPDATE `config` SET `config_value` = "'${API_URL}'" WHERE `group_name` LIKE "data-provider" AND `config_key` LIKE "url";' | docker exec -i mariadb mysql ushahidi +if [ ${STOP_MARIADB} ]; then + service mariadb stop +fi