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.

47 lines
1.2 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. #!/bin/bash
  2. function defaults {
  3. : ${DEVPI_SERVERDIR="/data/server"}
  4. : ${DEVPI_CLIENTDIR="/data/client"}
  5. echo "DEVPI_SERVERDIR is ${DEVPI_SERVERDIR}"
  6. echo "DEVPI_CLIENTDIR is ${DEVPI_CLIENTDIR}"
  7. export DEVPI_SERVERDIR DEVPI_CLIENTDIR
  8. }
  9. function initialise_devpi {
  10. echo "[RUN]: Initialise devpi-server"
  11. devpi-server --restrict-modify root --start --host 127.0.0.1 --port 3141
  12. devpi-server --status
  13. devpi use http://localhost:3141
  14. # Check the root password has been changed
  15. if devpi login root --password='' > /dev/null; then
  16. devpi login root --password=''
  17. devpi user -m root password="${DEVPI_PASSWORD}"
  18. devpi index -y -c public pypi_whitelist='*'
  19. else
  20. echo root password already changed
  21. fi
  22. devpi-server --stop
  23. devpi-server --status
  24. }
  25. defaults
  26. if [ "$1" = 'devpi' ]; then
  27. if [ ! -f $DEVPI_SERVERDIR/.serverversion ]; then
  28. initialise_devpi
  29. fi
  30. echo "[RUN]: Launching devpi-server"
  31. devpi-server --restrict-modify root --host 0.0.0.0 --port 3141 2>&1 | tee /data/server/devpi.log
  32. exit $?
  33. fi
  34. echo "[RUN]: Builtin command not provided [devpi]"
  35. echo "[RUN]: $@"
  36. exec "$@"