Skip to content

Instantly share code, notes, and snippets.

@tadas-s
Last active August 29, 2015 13:58
Show Gist options
  • Save tadas-s/10377723 to your computer and use it in GitHub Desktop.
Save tadas-s/10377723 to your computer and use it in GitHub Desktop.
www-data-writeable
#!/bin/bash
#
# Sets-up ACL for current + www-data users to allow writing to folder by both and deleting files created by each other.
# This simplifies some Symfony2 dev tasks
#
# *** NOT TO BE USED IN PRODUCTION SERVERS IN ANY WAY ***.
#
if [ -z "$1" ]; then
echo "Please give one or more folders"
exit 1
else
TARGET=$*
fi
setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx $TARGET
setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx $TARGET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment