Mini Shell

Direktori : /usr/share/python-cllib/scriptlets/
Upload File :
Current File : //usr/share/python-cllib/scriptlets/rpm_posttrans.sh

#!/usr/bin/bash

# RPM posttrans script, no arguments
# Note: Also called from Debian alt-python27-cllib.postinst scriptlet
# Arguments:
# $1 - share_path - /usr/share/python-cllib
# $2 - python python_sitelib path - /opt/cloudlinux/venv/lib/python3.11/site-packages
# $3 - hook marker file - /usr/share/cloudlinux/hooks/.inuse.tmp

# "python-cllib POST TRANS STARTED"

setcap "cap_sys_resource=ep" "$1"/cl.captain

if [ -f "/usr/local/directadmin/directadmin_cache.lock" ]; then
    # clean cache directory created for
    # internal purposes, not used anymore
    rm -rf /var/cache/clcommon/directadmin

    unused_command='directadmin_cache.py'
    scripts_dir='/usr/local/directadmin/scripts/custom'
    files="old_user_create_post.sh old_user_destroy_post.sh"

    # remove hooks that were not removed in usual way
    for file in $files
    do
        sed -i -e '/'"${unused_command}"'/d' ${scripts_dir}/$file || true;
    done;

    rm -f /usr/local/directadmin/directadmin_cache.lock
fi;

if [ -f "/usr/local/directadmin/directadmin" ]; then
    # See PTCLLIB-117
    echo 1 > /root/.suid_directadmin
    /usr/local/directadmin/directadmin p
fi;

# install hooks for supported control panels
"$2"/clcommon/public_hooks/bundle/hooks.py install

# clean marker
rm -f "$3"

if [ -f "/usr/bin/cldetect" ]; then
    /usr/bin/flock -n /var/run/cl_detect_for_users.cronlock /usr/bin/cldetect --detect-edition >| /opt/cloudlinux/cl_edition
    /usr/bin/flock -n /var/run/cl_detect_ls_for_users.cronlock /usr/bin/cldetect --detect-litespeed; echo "$?" > /opt/cloudlinux/litespeed_status
fi;

# "python-cllib POST TRANS FINISHED"
exit 0

Zerion Mini Shell 1.0