Avoid fixing permissions that look OK

This commit is contained in:
Thorsten von Eicken 2016-05-22 19:23:08 -07:00
parent 26bb8f6b34
commit 36ed1453ae
1 changed files with 7 additions and 2 deletions

View File

@ -222,8 +222,13 @@ else
echo "==> Warning: 'SASL_PASSWD' is not provided. /etc/postfix/sasl_passwd not created." echo "==> Warning: 'SASL_PASSWD' is not provided. /etc/postfix/sasl_passwd not created."
fi fi
echo "Fixing permissions" # Fix permissions, but skip this if 3 levels deep the user id is already set
chown -R 5000:5000 /var/mail if [ `find /var/mail -maxdepth 3 \! -user 5000 | grep -c .` != 0 ]; then
echo "Fixing /var/mail permissions"
chown -R 5000:5000 /var/mail
else
echo "Permissions in /var/mail look OK"
fi
echo "Creating /etc/mailname" echo "Creating /etc/mailname"
echo $(hostname -d) > /etc/mailname echo $(hostname -d) > /etc/mailname