dKj ( d Z ddlZddlZddlZddlZddlmZ ddlm Z m
Z
ddlmZ dZ
dded efd
Zd Zd Zd
Zd Zd Zedk r e s ed ej Ze ddd e ddd e ddd e Zej rej nej Z e
deej d e eej! ej" dS dS )u7
Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2020 All Rights Reserved
Licensed under CLOUD LINUX LICENSE AGREEMENT
http://cloudlinux.com/docs/LICENSE.TXT
Temporary script used to turn off part of the features that were previously
installed automatically as part of new server provisioning.
N)"disable_smart_advice_functionality)init_wpos_sentry_safely
setup_logging)is_wpos_supportedzO/opt/cloudlinux/flags/enabled-flags.d/smart-advice-plugin-install-reverted.flagFone_timeforcec t r| rt j d d S t s|st j d d S t t t
t j d d S )NzDSkipping uninstallation of smart-advice because it already succeededzRSkipping uninstallation of smart-advice because it was not installed automaticallyzUninstallation complete)_script_already_succededlogginginfo_enabled_automatically_turn_off_plugin_installations_uninstall_smart_advice_plugins_touch_success_marker)r r s 6py/clwpos/bin/clwpos_uninstall_smart_advice_plugins.pymainr s !! h [\\\!## E ijjj"$$$#%%%L*+++++ c J t j d t d S )NzETurning off notifications and automatic WordPress plugin installation)r r r r r r r ' s% LXYYY&(((((r c t j d st j d d S t j d t j ddgd d S )Nz/usr/sbin/cl-smart-advicez5SmartAdvice is not installed, plugins removal skippedz.Removing already installed SmartAdvice pluginszwordpress-plugin-uninstallT)check)ospathexistsr r
subprocessrunr r r r r , sq
7>>566 LMMMLABBBN#%A
r c T t t d d S )Na)openMARKER_FILEcloser r r r r 7 s$ c """""r c J t j t S )N)r r r r r r r r
r
; s
7>>+&&&r c d} d}t j | sdS t | d 5 }|D ]}||v r ddd dS ddd dS # 1 swxY w Y dS )zT
Detect whether Accelerate WP was enabled during automatic reconfiguration.
z$/var/log/cloudlinux/clcustomizer.logzEnabling Accelerate WPFrNT)r r r r )log_file
expected_textflines r r
r
? s 6H,M
7>>(## u
h D$$ $ s
A
AA #A __main__z
--one-time
store_true)defaultactionz--forcez --verbosez2/var/log/clwpos/uninstall-smart-advice-plugins.log)caller_name
console_level
file_levellogfile_path)FF)#__doc__argparser os.pathr r clwpos.wpos_adminr clwpos.logsetupr r clwpos.utilsr r boolr r r r r
r
__name__exitArgumentParserparseradd_argument
parse_argsargsverboseDEBUGCRITICALr. INFOr r r r r