Created
February 17, 2010 16:01
-
-
Save ekohl/306743 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import sys | |
if len(sys.argv) != 2: | |
print "Usage: %s fqdn" % sys.argv[0] | |
sys.exit(1) | |
fqdn = sys.argv[1] | |
split = fqdn.split(".") | |
domain = ".".join(split[-2:]) | |
try: | |
subdomain = split[-3] | |
except: | |
subdomain = '_' | |
print "/var/www/%s/%s/%s" % (domain, subdomain, fqdn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment