Mini Shell
#!/usr/bin/bash
###################################################
# Utils for hooks installation or removing #
###################################################
. /opt/cloudlinux/venv/usr/share/python-cllib/scripts/cl-common
####################################################
# CPanel & EasyApache hooks #
####################################################
before_apache_make="/scripts/before_apache_make"
posteasyapache="/scripts/posteasyapache"
postupcp="/scripts/postupcp"
target="cagefs"
common_path="/usr/share/cagefs/cpanel"
####################################################
# Hooks list #
####################################################
cagefs_HOOK="$common_path/cagefs_hook.sh"
suphp_patch_HOOK="$common_path/cpanel-compile-hook2.sh"
posteasyapache_hook="$common_path/cagefs_posteasyapache_hook.sh"
postupcp_hook="$common_path/cagefs_postupcp_hook.sh"
writeToLog "Install cPanel hooks" "$common_path"
#Install hook to build suexec
createHookHeader "$before_apache_make" "$target" "$common_path"
showBar 1
writeToLog "before_apache_make: Headers checked" "$common_path"
checkHookString "$before_apache_make" "$cagefs_HOOK" "CageFS Version $VERSION. Required for apache's suexec recompilation"
removeEmptyStringsFromFile "$before_apache_make"
showBar 2
writeToLog "before_apache_make checked" "$common_path"
#Install hook to patch suphp before make
createHookHeader "$before_apache_make" "$target" "$common_path"
showBar 3
writeToLog "before_apache_make: Headers checked" "$common_path"
checkHookString "$before_apache_make" "$suphp_patch_HOOK" "CageFS Version $VERSION. Required for apache's suphp recompilation"
removeEmptyStringsFromFile "$before_apache_make"
showBar 4
writeToLog "before_apache_make checked" "$common_path"
#Install hook to build suphp
createHookHeader "$posteasyapache" "$target" "$common_path"
showBar 5
writeToLog "posteasyapache: Headers checked" "$common_path"
checkHookString "$posteasyapache" "$posteasyapache_hook" "CageFS Version $VERSION. Required for suphp recompilation"
removeEmptyStringsFromFile "$posteasyapache"
showBar 6
writeToLog "posteasyapache checked" "$common_path"
#Install hook to update CageFS after update of CPanel
createHookHeader "$postupcp" "$target" "$common_path"
showBar 7
writeToLog "postupcp: Headers checked" "$common_path"
checkHookString "$postupcp" "$postupcp_hook" "CageFS Version $VERSION. Update CageFS after update of CPanel"
removeEmptyStringsFromFile "$postupcp"
showBar 8
writeToLog "postupcp checked" "$common_path"
writeToLog "Done installing hooks" "$common_path"
echo
Zerion Mini Shell 1.0