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 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 deluge paths to ${PUID}:${PGID}"
  9. chown -R ${RUN_AS}:${RUN_AS} \
  10. /config \
  11. /data \
  12. ${DELUGE_HOME} \
  13. ${DELUGE_DOWNLOAD_DIR} \
  14. ${DELUGE_INCOMPLETE_DIR} \
  15. ${DELUGE_WATCH_DIR}
  16. echo "Setting permission for files (644) and directories (755)"
  17. chmod -R go=rX,u=rwX \
  18. /config \
  19. /data \
  20. ${DELUGE_HOME} \
  21. ${DELUGE_DOWNLOAD_DIR} \
  22. ${DELUGE_INCOMPLETE_DIR} \
  23. ${DELUGE_WATCH_DIR}
  24. fi
  25. echo "
  26. -------------------------------------
  27. Deluge will run as
  28. -------------------------------------
  29. User name: ${RUN_AS}
  30. User uid: $(id -u ${RUN_AS})
  31. User gid: $(id -g ${RUN_AS})
  32. -------------------------------------
  33. "
  34. export PUID
  35. export PGID
  36. export RUN_AS