script-files-permissions-reset 408 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. # Smartly change permissions on selected directories
  3. # Copyright 2021 Bryan C. Roessler
  4. parent="${BASH_SOURCE[0]}"
  5. parent=${parent%/*}
  6. [[ -f $parent/script-functions ]] && . "$parent"/script-functions || exit 1
  7. is_root
  8. [[ $# -eq 0 ]] && DIRS=("/mnt/data") || DIRS=("$@")
  9. ask_ok "Reset permissions on ${DIRS[*]}?"
  10. chgrp smbgrp -R "${DIRS[@]}" && \
  11. chmod 6775 -R "${DIRS[@]}"
  12. exit $?