Hacked By AnonymousFox

Current Path : /usr/share/lve-utils/scriptlets/
Upload File :
Current File : //usr/share/lve-utils/scriptlets/rpm_preun.sh

#!/bin/bash
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

# RPM:
# $1 == 1 -- upgrade
# $1 == 0 -- uninstall

# DEB:
# $1 == remove/upgrade

# "lve-utils PRE UNINSTALL STARTED"


rhel=$2
solo_marker=$3
container_marker=$4

if [[ "$1" == 0 || $1 == "remove" ]]; then
    # uninstall of the package

    if [[ $rhel -gt 6 ]]; then
        # CL7, 8, Solo
        if [[ ! -f $solo_marker && ! -f $container_marker ]]; then
            systemctl --no-reload disable lvectl.service > /dev/null 2>&1
            systemctl stop lvectl.service > /dev/null 2>&1
            systemctl --no-reload disable lve_namespaces.service > /dev/null 2>&1
            systemctl stop lve_namespaces.service > /dev/null 2>&1
        fi

        systemctl daemon-reload
    else
        # CL6
        /sbin/service lvectl stop > /dev/null 2>&1
        /sbin/service lve_namespaces stop > /dev/null 2>&1
        /sbin/chkconfig --del lvectl
        /sbin/chkconfig --del lve_namespaces
        UPDATES='/etc/sysconfig/lve_updates'
        sed -i -e '/LVE_NAMESPACES/d' "$UPDATES" > /dev/null 2>&1
    fi

    if [[ ! -f $solo_marker && ! -f $container_marker ]]; then
        rm -f /etc/cron.d/lveutils-panel-cron > /dev/null 2>&1
        rm -f /etc/cron.d/cl_plus > /dev/null 2>&1
    fi

    rm -f "%{cloudlinux_cron_file}" > /dev/null 2>&1

    arch=$(uname -i)
    if [[ $arch == x86_64* ]]; then
      # For LU-1751 domain collector - all systems except CL6x32
      rm -f "%{crondir_dom_coll_file}" > /dev/null 2>&1
    fi

    # LU-1654: set cloudlinux=yes parameter in /usr/local/directadmin/custombuild/options.conf
    if [[ "DirectAdmin" == "$(/usr/bin/cldetect --detect-cp-nameonly)" ]]; then
        /usr/local/directadmin/custombuild/build set cloudlinux no
    fi
fi

# "lve-utils PRE UNINSTALL FINISHED"

Hacked By AnonymousFox1.0, Coded By AnonymousFox