�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!cpanel_pre_upcp_check_handlers_hook.py000075500000002541152530044130014314 0ustar00#!/usr/bin/python3.6 # Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Pre upcp check php handlers hook """ import subprocess import simplejson as json import sys def describe(): """ Description of the current hook for Cpanel """ descr = [ { 'category': 'System', 'event' : 'upcp', 'stage' : 'pre', 'hook' : '/usr/share/lve/modlscapi/hooks/cpanel_pre_upcp_check_handlers_hook.py', 'exectype': 'script', } ] return json.dumps(descr) if "__main__" == __name__: argv = sys.argv[1:] if '--describe' in argv: print(describe()) sys.exit(0) ret = subprocess.call(["/usr/share/lve/modlscapi/hooks/cpanel_check_handlers_hook.sh", "--pre"]) exit(ret) cpanelpostupcp.hook000075500000004034152530044130010467 0ustar00#!/bin/bash # Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #CloudLinux POSTUPCP INSTALL . /usr/share/lve/modlscapi/include/cpanel-common-lve function getEasyApacheVer(){ cat /var/cpanel/easy/apache/profile/_main.yaml | grep version | cut -d":" -f2 | tr -d ' ' | tr -d "'" } log=$(getLogFile) VER=$(getEasyApacheVer) if [ -e "/var/cpanel/conf/apache/main" ]; then if [ ! -e "/var/cpanel/conf/apache/main.bak" ]; then cp /var/cpanel/conf/apache/main /var/cpanel/conf/apache/main.bak fi cat /var/cpanel/conf/apache/main | sed -n '/mod_ruid2\.so/{N;s/.*//;x;d;};x;p;${x;p;}' | sed '/^$/d' > /var/cpanel/conf/apache/main.tmp cat /var/cpanel/conf/apache/main.tmp | sed -n '/mod_ruid2\.conf/{s/.*//;x;d;};x;p;${x;p;}' | sed '/^$/d' > /var/cpanel/conf/apache/main rm -f /var/cpanel/conf/apache/main.tmp fi "$common_path_of_cpanel/utils/checkconfdutil.pm" rebuildscript="/scripts/rebuildhttpdconf" if [ -e "$rebuildscript" ]; then "$rebuildscript" 1>>"$log" 2>>"$log" echo "Rebuilding conf ok..." >> "$log" else echo "Rubuilding failed..." >> "$log" fi restarthttpd="/scripts/restartsrv_httpd" if [ -e "$restarthttpd" ]; then "$restarthttpd" 1>>"$log" 2>>"$log" echo "Restarting apache ok..." >> "$log" else echo "Restarting apache failed..." >> "$log" fi writeToLog "[cpanelpostupcp] hook was successfully executed" cpanel_check_handlers_hook.sh000075500000002466152530044130012407 0ustar00#!/bin/bash CMD="$1" HLOG="/usr/share/lve/modlscapi/logs/last.pre.upcp.handlers" function get_current_handlers() { /usr/sbin/whmapi1 php_get_handlers | while read -r line; do echo -n "$line" | sed -n '/current_handler:/p' >> "$LOG" echo " $line" | sed -n '/version: [ea:alt]/p' >> "$LOG" done } function set_handlers_back() { cat "$HLOG" | while read -r line; do HANDLER=$(echo "$line" | cut -d ' ' -f2) PHPVERS=$(echo "$line" | cut -d ' ' -f4) echo "Setting $PHPVERS to $HANDLER handler" >> "$LOG" /usr/sbin/whmapi1 php_set_handler version="$PHPVERS" handler="$HANDLER" 2>/dev/null >/dev/null done } if [ "$CMD" == "--pre" ]; then LOG="/usr/share/lve/modlscapi/logs/Pre.upcp.$(date +%Y-%m-%d_%H:%M).log" get_current_handlers truncate -s 0 "$HLOG" cat "$LOG" >> "$HLOG" exit 0 fi if [ "$CMD" == "--post" ]; then LOG="/usr/share/lve/modlscapi/logs/Post.upcp.$(date +%Y-%m-%d_%H:%M).log" get_current_handlers if diff "$LOG" "$HLOG" >/dev/null ; then echo "Handlers matched after upcp" >> "$LOG" else echo "Error: Handlers not matched after upcp" >> "$LOG" # Uncomment on the server where the lsapi handler is automatically turned off after the upcp set_handlers_back fi exit 0 fi lsapi_patch_cpanel_hook.sh000075500000002006152530044130011727 0ustar00#!/bin/bash LOG="/usr/share/lve/modlscapi/logs/lsapi_patch.log" RES=$(cat "/usr/local/cpanel/Cpanel/WebServer/Supported/apache.pm" | grep "lsapi") if [ -z "$RES" ]; then current_path=$(pwd) common_path_of_cpanel="/usr/share/lve/modlscapi/tars/" cd "$common_path_of_cpanel" || exit if [ -e "apache_pm.patch" ]; then cd /usr/local/cpanel/Cpanel/WebServer/Supported || exit patch -N -i $common_path_of_cpanel/apache_pm.patch if [ $? != 0 ]; then echo "$(date +%Y-%m-%d_%H:%M) - Error applying patch..." >> "$LOG" cd "$current_path" || exit exit 1 else echo "$(date +%Y-%m-%d_%H:%M) - Patch was applied correctly..." >> "$LOG" cd "$current_path" || exit exit 0 fi else echo "$(date +%Y-%m-%d_%H:%M) - Cannot find apache_pm.patch..." >> "$LOG" cd "$current_path" || exit exit 1 fi else echo "$(date +%Y-%m-%d_%H:%M) - Already patched..." >> "$LOG" exit 0 fi cpanel_post_upcp_lsapi_hook.py000075500000002522152530044130012665 0ustar00#!/usr/bin/python3.6 # Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Mod_lsapi patch Cpanel post upcp hook """ import subprocess import simplejson as json import sys def describe(): """ Description of the current hook for Cpanel """ descr = [ { 'category': 'System', 'event' : 'upcp', 'stage' : 'post', 'hook' : '/usr/share/lve/modlscapi/hooks/cpanel_post_upcp_lsapi_hook.py', 'exectype': 'script', } ] return json.dumps(descr) if "__main__" == __name__: argv = sys.argv[1:] if '--describe' in argv: print(describe()) sys.exit(0) ret = subprocess.call(['/usr/share/lve/modlscapi/hooks/lsapi_patch_cpanel_hook.sh']) exit(ret) lsapi.hook000075500000002060152530044130006534 0ustar00#!/bin/bash # Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #Cloudlinux rpm hook. mod_lsapi . /usr/share/lve/modlscapi/include/cpanel-common-lve installModule_lsapi writeToLog "[modlsapi] hook was successfully executed" if [ -e "/usr/share/lve/modlscapi/global.enabled" ]; then /usr/bin/switch_mod_lsapi --enable-global writeToLog "[modlsapi] global config successfully restored" else writeToLog "[modlsapi] gloval config not enabled" fi buildlsphp.hook000075500000001507152530044130007577 0ustar00#!/bin/bash # Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #Cloudlinux rpm hook. mod_lsapi . /usr/share/lve/modlscapi/include/cpanel-common-lve /usr/bin/switch_mod_lsapi --build-native-lsphp writeToLog "[modlsapi] hook was successfully executed" clearconf.hook000075500000001633152530044130007365 0ustar00#!/bin/bash # Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #Clear old conf files. Need it if apache type change . /usr/share/lve/modlscapi/include/cpanel-common-lve #if [ -e "/usr/local/apache/conf/conf.d" ]; then # rm -f /usr/local/apache/conf/conf.d/lsapi.conf #fi writeToLog "[clearconf] hook was successfully executed" cpanel_post_upcp_check_handlers_hook.py000075500000002543152530044130014515 0ustar00#!/usr/bin/python3.6 # Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Post upcp check php handlers hook """ import subprocess import simplejson as json import sys def describe(): """ Description of the current hook for Cpanel """ descr = [ { 'category': 'System', 'event' : 'upcp', 'stage' : 'post', 'hook' : '/usr/share/lve/modlscapi/hooks/cpanel_post_upcp_check_handlers_hook.py', 'exectype': 'script', } ] return json.dumps(descr) if "__main__" == __name__: argv = sys.argv[1:] if '--describe' in argv: print(describe()) sys.exit(0) ret = subprocess.call(["/usr/share/lve/modlscapi/hooks/cpanel_check_handlers_hook.sh", "--post"]) exit(ret)