modify 632 B

1234567891011121314151617181920
  1. #!/usr/bin/env python3
  2. # This file a part of SHM. Copyright (C) Tom Li 2013.
  3. # License: LGPL version 3 or later.
  4. def create_alias(username, domain):
  5. domain_config = Config(CONFIG, username)
  6. domain_list = domain_config.domain
  7. domain_list.append(domain)
  8. domain = domain_list[0]
  9. domain_list_str = " ".join(domain_list)
  10. config_name = "/etc/nginx/sites-available/%s.conf" % domain
  11. user_group = "%s:%s" % (username, username)
  12. os.system("./nginx_conf %s %s > %s" % (username, domain_list, config_name))
  13. chown("%s:%s" % (username, username), config_name)
  14. domain_config.append_domain(domain)