docker-run.sh 758 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. # Define functions.
  3. function fixperms {
  4. chown -R $UID:$GID /data /opt/mautrix-whatsapp
  5. }
  6. if [ ! -f /data/config.yaml ]; then
  7. cp /opt/mautrix-whatsapp/example-config.yaml /data/config.yaml
  8. echo "Didn't find a config file."
  9. echo "Copied default config file to /data/config.yaml"
  10. echo "Modify that config file to your liking."
  11. echo "Start the container again after that to generate the registration file."
  12. exit
  13. fi
  14. if [ ! -f /data/registration.yaml ]; then
  15. /usr/bin/mautrix-whatsapp -g -c /data/config.yaml -r /data/registration.yaml
  16. echo "Didn't find a registration file."
  17. echo "Generated one for you."
  18. echo "Copy that over to synapses app service directory."
  19. exit
  20. fi
  21. cd /data
  22. fixperms
  23. exec su-exec $UID:$GID /usr/bin/mautrix-whatsapp