Commit 1564d839 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add setprojectshare

parent 99b5b6b9
#!/bin/bash -x
# 2006 (c) Etersoft http://etersoft.ru
# 2008 (c) Etersoft http://etersoft.ru
# 2011 (c) Etersoft http://etersoft.ru
# Authors:
# Alexander Plikus <pav@etersoft.ru>
# Vitaly Lipatov <lav@etersoft.ru>
# GNU Public License
# Work group:
NAME_GR="builder"
SET=
for i in 1 2 ; do
case "$1" in
("--help"|"-h"|"")
help
exit
;;
("--set"|"-s")
SET=1
shift
;;
("--group"|"-g")
shift
NAME_GR="$1"
shift
;;
esac
done
WORK_DIR="$1"
if ! [ -d "$WORK_DIR" ] ; then
echo "Directory '$WORK_DIR' is not found." ; echo
exit
fi
if [ -n "$SET" ]; then
gettext "Fix permissions and group..." ; echo
find "$WORK_DIR" ! -group "$NAME_GR" -print0 | xargs -0 --no-run-if-empty chgrp -v $NAME_GR
find "$WORK_DIR" ! -perm 0664 -type f -print0 | xargs -0 --no-run-if-empty chmod -v 0664
find "$WORK_DIR" ! -perm 02775 -type d -print0 | xargs -0 --no-run-if-empty chmod -v 02775
exit 0
else
exit 1
fi
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