Skip to content

Instantly share code, notes, and snippets.

@jrnickell
Created May 22, 2014 15:13
Show Gist options
  • Save jrnickell/e80d2d2027a2a7a011fe to your computer and use it in GitHub Desktop.
Save jrnickell/e80d2d2027a2a7a011fe to your computer and use it in GitHub Desktop.
Script to apply command-line (user) and apache write permissions to a folder
#!/bin/bash
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`
sudo setfacl -R -m u:$APACHEUSER:rwX -m u:`whoami`:rwX app/storage
sudo setfacl -dR -m u:$APACHEUSER:rwX -m u:`whoami`:rwX app/storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment