groupme/docker-run.sh

32 lines
779 B
Bash
Raw Permalink Normal View History

2018-08-24 20:06:55 +00:00
#!/bin/sh
if [[ -z "$GID" ]]; then
GID="$UID"
fi
# Define functions.
function fixperms {
2021-09-16 18:44:40 +00:00
chown -R $UID:$GID /data /opt/go-groupme
}
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
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
fixperms
2021-09-16 18:44:40 +00:00
exec su-exec $UID:$GID /usr/bin/go-groupme