Commit 1420ea12 authored by Anton Agapov's avatar Anton Agapov

New script groupcheck.sh

parent edd1be3b
#!/bin/bash
if [ -z "$1" ];then
ROOT_DIR="$(echo "$PWD")"
elif [ -d "$1" ];then
ROOT_DIR="$(echo "$1")"
else
echo
echo "The script checks recursively the group write access then"
echo "lists directory first and after the short break the files"
echo "that have no such permission."
echo
echo "Usage: groupcheck.sh [ROOT_DIR]"
echo "Where ROOT_DIR - the start point of the recursive check."
echo "If no ROOT_DIR specified, the current directory is applied instead."
echo
exit 1
fi
echo
echo "Directories:"
find "$ROOT_DIR" -type d ! -perm -g=w -exec ls -l -d --full-time "{}" \; | cut -d' ' -f1,3,4,9-
echo
echo "3 sec break before files output listing..."
echo
sleep 3
echo "Files:"
find "$ROOT_DIR" -type f ! -perm -g=w -exec ls -l --full-time "{}" \; | cut -d' ' -f1,3,4,9-
echo
#find "$ROOT_DIR" ! -perm -g=w -exec chmod g+w "{}" \;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment