Add Ushahidi IP refresh script
This commit is contained in:
parent
d9f00fe35f
commit
c44951bc72
@ -17,6 +17,7 @@ envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i mariadb mysql
|
||||
mkdir -p /srv/ushahidi/conf /srv/ushahidi/data
|
||||
chown 8014:8014 /srv/ushahidi/data
|
||||
envsubst <${SOURCE_DIR}/srv/ushahidi/conf/env >/srv/ushahidi/conf/env
|
||||
cp ${SOURCE_DIR}/srv/ushahidi/update-ip.sh /srv/ushahidi/update-ip.sh
|
||||
|
||||
# Populate database
|
||||
docker run --rm -h ushahidi --link mariadb -v /srv/ushahidi/conf/env:/srv/ushahidi/platform/.env ushahidi /srv/ushahidi/platform/bin/phinx migrate -c /srv/ushahidi/platform/application/phinx.php
|
||||
|
@ -7,6 +7,10 @@ depend() {
|
||||
use dns logger netmount postfix
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
/srv/ushahidi/update-ip.sh
|
||||
}
|
||||
|
||||
start() {
|
||||
/usr/bin/docker run -d --rm \
|
||||
--name ushahidi \
|
||||
|
5
ushahidi/srv/ushahidi/update-ip.sh
Executable file
5
ushahidi/srv/ushahidi/update-ip.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/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
|
Loading…
Reference in New Issue
Block a user