entrypoint.sh 985 B

123456789101112131415161718192021222324252627282930313233
  1. #! /bin/sh
  2. USER=mdc
  3. config_file="/config/mdc.ini"
  4. echo "---Setup Timezone to ${TZ}---"
  5. echo "${TZ}" > /etc/timezone
  6. echo "---Checking if UID: ${UID} matches user---"
  7. usermod -o -u ${UID} ${USER}
  8. echo "---Checking if GID: ${GID} matches user---"
  9. groupmod -o -g ${GID} ${USER} > /dev/null 2>&1 ||:
  10. usermod -g ${GID} ${USER}
  11. echo "---Setting umask to ${UMASK}---"
  12. umask ${UMASK}
  13. echo "---Taking ownership of data...---"
  14. if [ ! -d /config ]; then
  15. echo "---no config folder found, create...---"
  16. mkdir -p /config
  17. fi
  18. chown -R ${UID}:${GID} /app /data /config
  19. echo "Checking if config file exist"
  20. if [ ! -f "${config_file}" ]; then
  21. cp /app/config.template "${config_file}"
  22. echo "config file missing, we create a new config file, modify the config file and restart container please!"
  23. echo "没有找到配置文件,我们创建了一个新的配置文件,请修改后重启镜像"
  24. exit 1
  25. fi
  26. echo "Starting..."
  27. cd /data
  28. gosu ${USER} /app/Movie_Data_Capture "$@"