KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /usr/share/lve/modlscapi/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/lve/modlscapi/utils/cpanel_hooks_manage.pyc
�
w1fc@s�dZddlZddlZddlZddlZdZdZd�Zd�Zd�Z	d�Z
d	�Zd
ekr�ej
eejd��ndS(sO
Mod_lsapi hooks manager for Cpanel EA4
-i - installs hooks
-d - removes hooks
i����Ns/var/cpanel/hooks.yamls"/usr/local/cpanel/bin/manage_hookscCstjdt|f�dS(s
    Write message to log
    s%s: %sN(tsyslogt__file__(tmsg((s5/usr/share/lve/modlscapi/utils/cpanel_hooks_manage.pyt	log_error"scCs�yttd�}Wnttfk
r-tSXtj|�}y1x*|||D]}|d|krOtSqOWWntk
r�tSXtS(s3
    Check is hook installed in current cpanel
    trthook(	topentYAML_HOOK_BASEtIOErrortOSErrortFalsetyamltloadtTruetKeyError(tcategoryteventthook_script_pathtstreamt	hook_baseti((s5/usr/share/lve/modlscapi/utils/cpanel_hooks_manage.pytis_hook_installed)s
cCsYt|||�sUdt||||f}tj|�rUtd||f�dSndS(s'
    Install event hook for cpanel
    s=%s add script %s --category=%s --event=%s --stage=%s --manuals&Can`t add hook to category:%s event:%sii(RtMANAGE_HOOKtostsystemR(RRRtstagetcmd((s5/usr/share/lve/modlscapi/utils/cpanel_hooks_manage.pytinstall_hook<scCsDdt||||f}tj|�r@td||f�dSdS(s"
    Remove cpanel event hook
    s@%s delete script %s --category=%s --event=%s --stage=%s --manuals)Can't delete hook to category:%s event:%sii(RRRR(RRRRR((s5/usr/share/lve/modlscapi/utils/cpanel_hooks_manage.pytremove_hookKscCs�d}d|krftdddd�p*|}tdddd�pE|}tdddd	�p`|}n`d
|kr�tdddd�p�|}tdddd�p�|}tdddd	�p�|}n|S(s-
    Install or delete cpanel event hook
    is-is=/usr/share/lve/modlscapi/hooks/cpanel_post_upcp_lsapi_hook.pytSystemtupcptpostsF/usr/share/lve/modlscapi/hooks/cpanel_post_upcp_check_handlers_hook.pysE/usr/share/lve/modlscapi/hooks/cpanel_pre_upcp_check_handlers_hook.pytpres-d(RR(targvtresult((s5/usr/share/lve/modlscapi/utils/cpanel_hooks_manage.pytmainYs t__main__i(t__doc__RtsysRRRRRRRRR#t__name__texitR!(((s5/usr/share/lve/modlscapi/utils/cpanel_hooks_manage.pyt<module>s					

Anon7 - 2021