fix perms script
This commit is contained in:
@@ -28,21 +28,21 @@ in {
|
|||||||
|
|
||||||
# Fix ownership for archives directory
|
# Fix ownership for archives directory
|
||||||
echo "starting ${archives_path}"
|
echo "starting ${archives_path}"
|
||||||
chown -Rc root:archives ${archives_path}
|
find "${archives_path}" -type d -exec sh -c 'chown root:archives "$@" chmod 770 "$@"' _ {} +
|
||||||
chmod -Rc 2770 ${archives_path}
|
find "${archives_path}" -type f -exec sh -c 'chown root:archives "$@" chmod 660 "$@"' _ {} +
|
||||||
|
|
||||||
# Fix ownership for media directory
|
# Fix ownership for media directory
|
||||||
echo "starting ${media_path}"
|
echo "starting ${media_path}"
|
||||||
chown -Rc root:media ${media_path}
|
find "${media_path}" -type d -exec sh -c 'chown root:media "$@" chmod 770 "$@"' _ {} +
|
||||||
chmod -Rc 2770 ${media_path}
|
find "${media_path}" -type f -exec sh -c 'chown root:media "$@" chmod 660 "$@"' _ {} +
|
||||||
|
|
||||||
# Fix user directories
|
# Fix user directories
|
||||||
for user_dir in ${users_path}/*; do
|
for user_dir in ${users_path}/*; do
|
||||||
if [ -d "$user_dir" ]; then
|
if [ -d "$user_dir" ]; then
|
||||||
user=$(basename "$user_dir")
|
user=$(basename "$user_dir")
|
||||||
echo "starting $user_dir"
|
echo "starting $user_dir"
|
||||||
chown -Rc "$user:$user" "$user_dir"
|
find "$user_dir" -type d -exec sh -c 'chown $user:$user "$@" chmod 770 "$@"' _ {} +
|
||||||
chmod -Rc 770 "$user_dir"
|
find "$user_dir" -type f -exec sh -c 'chown $user:$user "$@" chmod 660 "$@"' _ {} +
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "fin"
|
echo "fin"
|
||||||
|
|||||||
Reference in New Issue
Block a user