You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
654 B

  1. #!/bin/sh
  2. ## Change GID for USER?
  3. if [ -n "${USER_GID}" ] && [ "${USER_GID}" != "`id -g ${USER}`" ]; then
  4. sed -i -e "s/^${USER}:\([^:]*\):[0-9]*/${USER}:\1:${USER_GID}/" /etc/group
  5. sed -i -e "s/^${USER}:\([^:]*\):\([0-9]*\):[0-9]*/${USER}:\1:\2:${USER_GID}/" /etc/passwd
  6. fi
  7. ## Change UID for USER?
  8. if [ -n "${USER_UID}" ] && [ "${USER_UID}" != "`id -u ${USER}`" ]; then
  9. sed -i -e "s/^${USER}:\([^:]*\):[0-9]*:\([0-9]*\)/${USER}:\1:${USER_UID}:\2/" /etc/passwd
  10. fi
  11. for FOLDER in /data/gitea/conf /data/gitea/log /data/git /data/ssh; do
  12. mkdir -p ${FOLDER}
  13. done
  14. if [ $# -gt 0 ]; then
  15. exec "$@"
  16. else
  17. exec /bin/s6-svscan /etc/s6
  18. fi