#copyright(c)Syslint technologies
import os
import sys
from shellcolor import shellcolor
from datetime import datetime
import subprocess
import version
import deps
import sys
import pre
def start():
    now = datetime.now()
    sys.stdout.write("Copyright (C) 2009-"+str(now.year)+", Syslint Technologies India(P) LTD.")
    sys.stdout.write("""
                            _                                       
  ___  _ __   _ __    __ _ (_) _ __  __  __    ___  ___   _ __ ___  
 / __|| '_ \ | '_ \  / _` || || '_ \ \ \/ /   / __|/ _ \ | '_ ` _ \ 
| (__ | |_) || | | || (_| || || | | | >  <  _| (__| (_) || | | | | |
 \___|| .__/ |_| |_| \__, ||_||_| |_|/_/\_\(_)\___|\___/ |_| |_| |_|
      |_|            |___/                                          
        
        """)
    sys.stdout.write("\n")
    sys.stdout.write("Starting Cpnginx auto installer ... \n")
    pre.precheck()
    deps.install_deps()
    deps.install_python()
    deps.copy_core()
    deps.ea4_enable_mod_remoteip()
    deps.ea4_default_php_fpm()
    deps.change_apache_port()
    deps.install_nginx()
    deps.install_whm_plugin()
    deps.install_cpanel_plugin()
    deps.install_hooks()
    deps.install_cron()
    deps.setup_templates()
    deps.setup_chkservd()
    deps.restart_services()
    sys.stdout.write("---------------------------------------------------------------------------------\n")
    sys.stdout.write("\t\t Cpnginx installation has been completed \n")
    sys.stdout.write("\tPlease refer the documentation from https://cpnginx.com to getting start\n ")
    sys.stdout.write("---------------------------------------------------------------------------------\n")
