6 lines
333 B
Bash
Executable File

#!/bin/sh
URL=$(ip route get 1 | awk '{print $NF;exit}')
FULL_URL='\\\"https:\\\\/\\\\/'${URL}:8413'\\\\/platform\\\\/api\\\\/v3\\\\/config\\\\/data-provider\\\"'
echo 'UPDATE `config` SET `config_value` = "'${FULL_URL}'" WHERE `group_name` LIKE "data-provider" AND `config_key` LIKE "url";' | docker exec -i mariadb mysql ushahidi