2018-08-24 20:06:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-01-12 13:54:04 +00:00
|
|
|
if [[ -z "$GID" ]]; then
|
|
|
|
GID="$UID"
|
|
|
|
fi
|
|
|
|
|
2018-10-24 13:46:15 +00:00
|
|
|
# Define functions.
|
|
|
|
function fixperms {
|
2021-09-16 18:44:40 +00:00
|
|
|
chown -R $UID:$GID /data /opt/go-groupme
|
2018-10-24 13:46:15 +00:00
|
|
|
}
|
|
|
|
|
2019-01-12 13:54:04 +00:00
|
|
|
if [[ ! -f /data/config.yaml ]]; then
|
2021-09-16 18:44:40 +00:00
|
|
|
cp /opt/go-groupme/example-config.yaml /data/config.yaml
|
2018-08-24 20:06:55 +00:00
|
|
|
echo "Didn't find a config file."
|
|
|
|
echo "Copied default config file to /data/config.yaml"
|
|
|
|
echo "Modify that config file to your liking."
|
|
|
|
echo "Start the container again after that to generate the registration file."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2019-01-12 13:54:04 +00:00
|
|
|
if [[ ! -f /data/registration.yaml ]]; then
|
2021-09-16 18:44:40 +00:00
|
|
|
/usr/bin/go-groupme -g -c /data/config.yaml -r /data/registration.yaml
|
2018-08-24 20:06:55 +00:00
|
|
|
echo "Didn't find a registration file."
|
|
|
|
echo "Generated one for you."
|
|
|
|
echo "Copy that over to synapses app service directory."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd /data
|
2018-10-24 13:46:15 +00:00
|
|
|
fixperms
|
2021-09-16 18:44:40 +00:00
|
|
|
exec su-exec $UID:$GID /usr/bin/go-groupme
|