docker-run.sh 649 B

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