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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

3 年之前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. {% for folder in shared_folders.keys() | list %}
  3. # {{folder}}
  4. mkdir -p "{{folder}}"
  5. {% if shared_folders[folder].owner is defined %}
  6. chown \
  7. {% if shared_folders[folder].recursive is defined and shared_folders[folder].recursive %}
  8. -R \
  9. {% endif %}
  10. "{{shared_folders[folder].owner}}" "{{folder}}"
  11. {% endif %}
  12. {% if shared_folders[folder].group is defined %}
  13. chgrp \
  14. {% if shared_folders[folder].recursive is defined and shared_folders[folder].recursive %}
  15. -R \
  16. {% endif %}
  17. "{{shared_folders[folder].group}}" "{{folder}}"
  18. {% endif %}
  19. {% if shared_folders[folder].acls is defined %}
  20. setfacl --remove-all \
  21. {% if shared_folders[folder].recursive is defined and shared_folders[folder].recursive %}
  22. --recursive \
  23. {% endif %}
  24. -m user::rwX \
  25. -m group::--- \
  26. -m other::--- \
  27. {% for acl in shared_folders[folder].acls %}
  28. -m {{acl}} \
  29. {% endfor %}
  30. "{{folder}}"
  31. setfacl --default \
  32. {% if shared_folders[folder].recursive is defined and shared_folders[folder].recursive %}
  33. --recursive \
  34. {% endif %}
  35. -m user::rwx \
  36. -m group::--- \
  37. -m other::--- \
  38. {% for acl in shared_folders[folder].acls %}
  39. -m {{acl}} \
  40. {% endfor %}
  41. "{{folder}}"
  42. {% endif %}
  43. {% endfor %}