diff --git a/check_permissions.sh b/check_permissions.sh index 82a1d3d..fe9ee19 100755 --- a/check_permissions.sh +++ b/check_permissions.sh @@ -71,6 +71,12 @@ for arg in $@; do PRINT_FILES=1 PRINT_DIRS=1 ;; + --no-print-files) + PRINT_FILES=0 + ;; + --no-print-dirs) + PRINT_DIRS=0 + ;; *) if [[ ! -d $arg ]]; then echo "# Skipped $arg" @@ -88,7 +94,7 @@ echo "# Searching for files which do not match at least '$FILE_PERMS' ..." WRONG_FILES=(`find $SEARCH_DIRS -type f ! -perm -$FILE_PERMS -print`) -if [[ $PRINT_FILES -eq 1 ]]; then +if [[ $PRINT_DIRS -eq 1 ]]; then echo "# ** directories with wrong permissions:" for dir in ${WRONG_DIRS[@]}; do if [[ $FIX_PERMISSIONS -eq 1 ]]; then @@ -103,7 +109,9 @@ for dir in ${WRONG_DIRS[@]}; do echo -e "$dir\t\t$(stat -c "%a" $dir)" fi done +fi +if [[ $PRINT_FILES -eq 1 ]]; then echo "# ** files with wrong permissions:" for file in ${WRONG_FILES[@]}; do if [[ $FIX_PERMISSIONS -eq 1 ]]; then