Last active
July 4, 2016 16:53
-
-
Save alexander-mart/9b069a813c8777ad96fc1ffbb4c6730e to your computer and use it in GitHub Desktop.
Для веб-сервера. Скрипт был написан для исправления прав на папки пользователей со скопированными в них под рутом сайтами после переезда сервера.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Проходим по порядку все директории пользователей в /home | |
# и меняем владельца подпапки /home/%user%/web/ на этого пользователя и одноимённую группу | |
for dir in `ls -F1 /home/ | grep -e ./ | tr -d \/` | |
do | |
echo 'Fix owner and group for directory:' $dir | |
user=$dir | |
group=$user | |
chown -hR -v $user:$group /home/$dir/web/ | |
echo '' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment