You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

63 lines
1.9 KiB

coder-dir() {
if [ $UID -ne 0 ]; then
if [ -d "$1" ]; then
sudo find "$1" -type d -exec chgrp coders {} \;
sudo find "$1" -type d -exec chmod g+s {} \;
sudo find "$1" -type f -exec chgrp coders {} \;
sudo find "$1" -type f -exec chmod 664 {} \;
sudo find "$1" -type d -exec chmod 775 {} \;
else
echo "DIR not found"
fi
else
if [ -d "$1" ]; then
find "$1" -type d -exec chgrp coders {} \;
find "$1" -type d -exec chmod g+s {} \;
find "$1" -type f -exec chgrp coders {} \;
find "$1" -type f -exec chmod 664 {} \;
find "$1" -type d -exec chmod 775 {} \;
else
echo "DIR not found"
fi
fi
}
www-data-dir() {
if [ $UID -ne 0 ]; then
if [ -d "$1" ]; then
sudo find "$1" -type d -exec chgrp www-data {} \;
sudo find "$1" -type d -exec chmod g+s {} \;
sudo find "$1" -type f -exec chgrp www-data {} \;
sudo find "$1" -type f -exec chmod 664 {} \;
sudo find "$1" -type d -exec chmod 775 {} \;
else
echo "DIR not found"
fi
else
if [ -d "$1" ]; then
find "$1" -type d -exec chgrp www-data {} \;
find "$1" -type d -exec chmod g+s {} \;
find "$1" -type f -exec chgrp www-data {} \;
find "$1" -type f -exec chmod 664 {} \;
find "$1" -type d -exec chmod 775 {} \;
else
echo "DIR not found"
fi
fi
}
web-dir() {
if [ $UID -ne 0 ]; then
if [ -d "$1" ]; then
sudo find "$1" -type f -exec chmod 664 {} \;
sudo find "$1" -type d -exec chmod 775 {} \;
else
echo "DIR not found"
fi
else
if [ -d "$1" ]; then
find "$1" -type f -exec chmod 664 {} \;
find "$1" -type d -exec chmod 775 {} \;
else
echo "DIR not found"
fi
fi
}