Skip to content

Instantly share code, notes, and snippets.

@srobbin
Created October 15, 2009 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srobbin/211219 to your computer and use it in GitHub Desktop.
Save srobbin/211219 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
"""
Performs the basic setup instructions for a new Expression Engine install
as outlined here: http://expressionengine.com/docs/installation/installation.html
Accepts:
One parameter: if you'd like to rename the system folder (recommended, but optional)
Usage:
python setup_ee.py
python setup_ee.py new_system_name
Author: Scott Robbin (http://srobbin.com)
"""
import os, sys
# Expression Engine recommends doing the following command to these files
# Note: This is for NEW installations
files_to = {
"rm -rf": [
'READ_THIS_FIRST.txt',
'system/upgrade.php',
'system/upgrade/',
],
'chmod 666': [
'path.php',
'system/config.php',
'system/config_bak.php',
],
'chmod 777': [
'images/avatars/uploads',
'images/captchas/',
'images/member_photos/',
'images/pm_attachments/',
'images/signature_attachments/',
'images/uploads/',
'system/cache/'
]
}
# Execute the commands
for cmd in files_to:
for file_name in files_to[cmd]:
os.system("%s %s" % (cmd, file_name))
pass
# Did the user ask to rename the system folder?
try:
if sys.argv[1]:
os.system("mv system %s" % sys.argv[1])
except:
pass
# Probably want to delete this file, too
os.system("rm %s" % sys.argv[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment