docker-entrypoint.sh 780 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. set -e
  3. # Source docker-entrypoint.sh:
  4. # https://github.com/docker-library/postgres/blob/master/9.4/docker-entrypoint.sh
  5. # https://github.com/kovalyshyn/docker-freeswitch/blob/vanilla/docker-entrypoint.sh
  6. if [ "$1" = 'freeswitch' ]; then
  7. if [ ! -f "/etc/freeswitch/freeswitch.xml" ]; then
  8. mkdir -p /etc/freeswitch
  9. cp -varf /usr/share/freeswitch/conf/vanilla/* /etc/freeswitch/
  10. fi
  11. chown -R freeswitch:freeswitch /etc/freeswitch
  12. chown -R freeswitch:freeswitch /var/{run,lib}/freeswitch
  13. if [ -d /docker-entrypoint.d ]; then
  14. for f in /docker-entrypoint.d/*.sh; do
  15. [ -f "$f" ] && . "$f"
  16. done
  17. fi
  18. exec gosu freeswitch /usr/bin/freeswitch -u freeswitch -g freeswitch -nonat -c
  19. fi
  20. exec "$@"