dKj (dZddlZddlZddlZddlZddlmZddlm Z m Z ddl m Z dZ dded efd Zd Zd Zd ZdZdZedkre s edejZedddedddedddeZejrejnejZe deej de eej!ej"dSdS)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_timeforcectr|rtjddSts|stjddSt t t tjddS)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)rrs 6py/clwpos/bin/clwpos_uninstall_smart_advice_plugins.pymainrs!!h [\\\ ! # #E ijjj"$$$#%%% L*+++++cJtjdtdS)NzETurning off notifications and automatic WordPress plugin installation)r r rrrrr's% LXYYY&(((((rctjdstjddStjdt jddgddS)Nz/usr/sbin/cl-smart-advicez5SmartAdvice is not installed, plugins removal skippedz.Removing already installed SmartAdvice pluginszwordpress-plugin-uninstallT)check)ospathexistsr r subprocessrunrrrrr,sq 7>>5 6 6 LMMM LABBBN#%A rcTttddS)Na)open MARKER_FILEcloserrrrr7s$c  """""rcJtjtS)N)rrrr rrrr r ;s 7>>+ & &&rcd}d}tj|sdSt|d5}|D]}||vrddddS ddddS#1swxYwYdS)zT Detect whether Accelerate WP was enabled during automatic reconfiguration. z$/var/log/cloudlinux/clcustomizer.logzEnabling Accelerate WPFrNT)rrrr)log_file expected_textflines rr r ?s6H,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_level logfile_path)FF)#__doc__argparser os.pathrrclwpos.wpos_adminrclwpos.logsetuprr clwpos.utilsrr boolrrrrr r __name__exitArgumentParserparser add_argument parse_argsargsverboseDEBUGCRITICALr.INFOrrrrrrCs@@@@@@BBBBBBBB******_  , ,4 , , , , , ))) ###'''" z     Q $X $ & &F  eLIII  5FFF  U<HHH     D%)\GGMMw7GMM#<I  D #####-r