Created
December 26, 2012 19:41
-
-
Save darraghenright/4382542 to your computer and use it in GitHub Desktop.
A quick script to set requisite write permissions to various files and folders in a PyroCMS installation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# helper function | |
# | |
function exit_with_msg() { echo "Error! $1. Exiting script."; exit 1; } | |
# | |
# hi :) | |
# | |
clear | |
echo 'Welcome! Setting write permissions for your PyroCMS installation!' | |
# | |
# check if we're probably in a pyro dir | |
# | |
[[ ! -d 'system/cms/cache' ]] && exit_with_msg 'This does not look like a PyroCMS site root' | |
# | |
# make all the following paths/files word-writable | |
# | |
chmod a+w system/cms/cache \ | |
system/cms/config \ | |
system/cms/config/config.php \ | |
addons \ | |
assets/cache \ | |
uploads \ | |
# | |
# display status | |
# | |
[[ 0 -ne $? ]] && exit_with_msg 'Bash encountered a non-zero exit message while trying to chmod paths' | |
# | |
# done :) | |
# | |
echo 'Success! Task complete :)' | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment