25 lines
454 B
Bash
Executable File
25 lines
454 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
|
|
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
|
cat <<EOF
|
|
Usage: $(basename "$0") [-h]
|
|
|
|
Set default permissions for files and directories in current directory.
|
|
|
|
Options:
|
|
-h, --help Show this help message
|
|
|
|
Sets:
|
|
- Files: 0664 (rw-rw-r--)
|
|
- Directories: 0775 (rwxrwxr-x)
|
|
|
|
EOF
|
|
exit 0
|
|
fi
|
|
|
|
# TODO permissions via arguments
|
|
|
|
find . -type f -exec chmod 0664 {} +
|
|
find . -type d -exec chmod 0775 {} +
|