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.

userSetup.sh 1000B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # More/less taken from https://github.com/linuxserver/docker-baseimage-alpine/blob/3eb7146a55b7bff547905e0d3f71a26036448ae6/root/etc/cont-init.d/10-adduser
  3. RUN_AS=root
  4. if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
  5. RUN_AS=abc
  6. if [ ! "$(id -u ${RUN_AS})" -eq "$PUID" ]; then usermod -o -u "$PUID" ${RUN_AS} ; fi
  7. if [ ! "$(id -g ${RUN_AS})" -eq "$PGID" ]; then groupmod -o -g "$PGID" ${RUN_AS} ; fi
  8. echo "Setting owner for transmission paths to ${PUID}:${PGID}"
  9. chown -R ${RUN_AS}:${RUN_AS} ${TRANSMISSION_HOME}
  10. chown ${RUN_AS}:${RUN_AS} \
  11. /config \
  12. ${TRANSMISSION_DOWNLOAD_DIR} \
  13. ${TRANSMISSION_INCOMPLETE_DIR} \
  14. ${TRANSMISSION_WATCH_DIR}
  15. fi
  16. echo "
  17. -------------------------------------
  18. Transmission will run as
  19. -------------------------------------
  20. User name: ${RUN_AS}
  21. User uid: $(id -u ${RUN_AS})
  22. User gid: $(id -g ${RUN_AS})
  23. -------------------------------------
  24. "
  25. export PUID
  26. export PGID
  27. export RUN_AS