Permalink
Browse files

An attempt at a shell script to set correct directory/file permissions.

  • Loading branch information...
1 parent 0128101 commit 23b06e103ee9f279749a52773d12351de1d27a30 Jeremy Kendall committed Sep 11, 2013
Showing with 23 additions and 0 deletions.
  1. +23 −0 bin/default-permissions
View
@@ -0,0 +1,23 @@
+#!/bin/sh
+echo "This command uses chown and chmod. You may need to use sudo"
+
+echo "Your username: "
+read USERNAME
+
+echo "Apache username: "
+read GROUPNAME
+
+chown $USERNAME:$GROUPNAME db
+chown $USERNAME:$GROUPNAME logs
+chown $USERNAME:$GROUPNAME public
+chown $USERNAME:$GROUPNAME tmp
+
+chmod -R 775 db
+chmod -R 775 logs
+chmod -R 775 tmp
+
+chmod 775 public
+find public -type d -exec chmod 775 {} \;
+find public -type f -exec chmod 664 {} \;
+
+echo "Finished!"

0 comments on commit 23b06e1

Please sign in to comment.