HEX
Server: Apache/2.4.65 (Debian)
System: Linux srv39710 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
User: root (0)
PHP: 8.4.11
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: //usr/local/mgr5/sbin/remove_apache_instance.sh
#!/bin/bash

set -eu

if [ ${#} != 1 ] ; then
    echo usage: ${0} '<suffix>'
    exit 1
fi

if [ -e /etc/redhat-release ]; then
    NATIVE_PATH=/etc/httpd
else
    NATIVE_PATH=/etc/apache2
fi
SUFFIX=${1#"isp-"}
INSTANCE_PATH=${NATIVE_PATH}-isp-${SUFFIX}
INSTANCE_NAME=${INSTANCE_PATH##*/}

find ${INSTANCE_PATH} \( -not -path "${INSTANCE_PATH}" -and -not -path "${INSTANCE_PATH}/users-php*" -and -not -path "${INSTANCE_PATH}/vhosts-php*" \) -delete

if ! [ -e /etc/redhat-release ]; then
    for a in a2enmod a2dismod a2ensite a2dissite a2enconf a2disconf apache2ctl ; do
        rm -f /usr/local/sbin/${a}-isp-${SUFFIX}
    done
fi

rm -rf /run/${INSTANCE_NAME}
rm -rf /var/log/${INSTANCE_NAME}

rm -f /etc/logrotate.d/${INSTANCE_NAME}