?
Current Path : /usr/share/lve/modlscapi/hooks/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : //usr/share/lve/modlscapi/hooks/cpanelpostupcp.hook |
#!/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.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 "$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"