#!/opt/cppython/bin/python3 -B
"""
copyright(c) cpnginx.com
Hook for fixing apache domlog bug 
"""
import os
import sys
import json
import subprocess


def main():
    print ("Running cpnginx  Apache Domlog  Fix Hook ")
    cmd="sed -i s/%h/%a/g /var/cpanel/templates/apache2_4/ea4_main.default"
    process = subprocess.run(cmd, shell=True,check=True,stdout=subprocess.PIPE)
    out=process.stdout
    cmdap="/usr/local/cpanel/scripts/rebuildhttpdconf"
    processd = subprocess.run(cmdap, shell=True,check=True,stdout=subprocess.PIPE)
    outd=processd.stdout
    print ("Cpnginx post hook completed")
    return(1)
if __name__ == "__main__":
    main()
