Set working dir and server URL for Motech, related to #166
This commit is contained in:
parent
f5214cf64e
commit
f4e76c340a
@ -4,9 +4,11 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=motech
|
||||
WorkingDirectory=/srv/motech
|
||||
ExecStartPre=/srv/motech/update-ip.sh
|
||||
ExecStart=/srv/motech/bin/startup.sh
|
||||
ExecStop=/srv/motech/bin/shutdown.sh
|
||||
User=motech
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -1,2 +1,3 @@
|
||||
system.language=en
|
||||
login.mode=repository
|
||||
server.url=http://127.0.0.1
|
||||
|
4
motech/srv/motech/update-ip.sh
Executable file
4
motech/srv/motech/update-ip.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
URL=$(ip route get 1 | awk '{print $NF;exit}')
|
||||
sed -i "s|^server\.url.*|server.url=https://${URL}/motech|" /srv/motech/.motech/config/motech-settings.properties
|
Loading…
Reference in New Issue
Block a user