Created
March 5, 2012 04:13
-
-
Save issackelly/1976590 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def check_strange_installation(): | |
default_exists = set([ | |
'admin', | |
'displayRules', | |
'favicon.ico', | |
'index.php', | |
'resources', | |
'templates', | |
'variables.php', | |
'apple-touch-icon-72x72.png', | |
'apple-touch-icon-114x114.png' | |
'apple-touch-icon.png', | |
'googlehostedservice.html', | |
]) | |
odd_ones = [] | |
custom_cogs = [] | |
for s in settings.SITES: | |
#import pdb; pdb.set_trace() | |
site = settings.SITES[s] | |
files = [] | |
out = run("ls -l %s/web/content" % site['path']) | |
lines = out.split('\n') | |
lines.pop(0) | |
for l in lines: | |
files.append(re.split(r'(\s)+', l)[14]) | |
section = set(files) - default_exists | |
print section | |
if section: | |
if 'cogs' in section: | |
custom_cogs.append(site['domain']) | |
odd_ones.append("*%s \n\t%s" % ( | |
site['domain'], | |
"\n\t".join(section), | |
)) | |
print "\n".join(odd_ones) | |
print "\n[cogs on]" | |
for c in custom_cogs: | |
print "\t%s" % c | |
return odd_ones, custom_cogs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment