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.

umount-volumes.sh 492B

12345678910111213141516171819202122
  1. #! /bin/sh
  2. #
  3. if [ "$(id -u)" -ne 0 ]; then
  4. echo "must be ran as root"
  5. exit 1
  6. fi
  7. volumes="certs dynamic logs root static webroot"
  8. for volume in ${volumes}; do
  9. mount_path="${PWD}/traefik-volumes/${volume}"
  10. if [ "${volume}" = "webroot" ]; then
  11. mount_path="${PWD}/${volume}-volume"
  12. fi
  13. if [ "${volume}" = "root" ]; then
  14. mount_path="${PWD}/${volume}-volume"
  15. fi
  16. if mountpoint "${mount_path}" -q; then
  17. echo "umounting ${mount_path}"
  18. umount "${mount_path}"
  19. fi
  20. done