Skip to content

Commit efd99c5

Browse files
author
Stephen Hoogendijk
committed
Small fix, added license information
1 parent 57c6caf commit efd99c5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

create-vhost.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/usr/bin/env python
2-
from _socket import getservbyport
3-
from subprocess import Popen
2+
"""
3+
Vhost creation script for Apache2 vhosts
4+
5+
Author: Stephen Hoogendijk
46
7+
Licensed under the GPL V2 License
8+
"""
9+
10+
from _socket import getservbyport
511
import optparse, re, os, time, urllib2, ConfigParser, subprocess
612

713
domain = None
@@ -24,7 +30,7 @@
2430
configfile = cwd+'/create-vhost.ini'
2531

2632
print '--- Create vhost script for Apache2 ---'
27-
print '--- Copyright Stephen Hoogendijk 2013, Licensed under the GPL V2 License ---'
33+
print '--- Author: Stephen Hoogendijk, Licensed under the GPL V2 License ---'
2834
print
2935

3036
if not os.path.exists(configfile):
@@ -158,7 +164,7 @@ def _check_vhost():
158164
exit('The apache port is not valid!')
159165

160166
# validate the given domain name
161-
if not re.match("^(([a-zA-Z0-9]+([\-])?[a-zA-Z0-9]+)+(\.)?)+[a-zA-Z]{2,6}$", str(domain)) and 'www' not in domain:
167+
if not re.match("^(([a-zA-Z0-9]+([\-])?[a-zA-Z0-9]+)+(\.)?)+[a-zA-Z]{2,6}$", str(domain)) or 'www' in domain:
162168
exit('Domain not valid: %s. Please enter a domain without www' % domain)
163169

164170
# check the git repo if it has been set

0 commit comments

Comments
 (0)