From 54e770bb967e7add436bc98a1653ade22756e220 Mon Sep 17 00:00:00 2001 From: hosh1 Date: Sun, 10 Aug 2025 03:06:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20=D0=BE?= =?UTF-8?q?=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20(=D1=8F=20=D0=B4=D0=B5=D0=B1?= =?UTF-8?q?=D0=B8=D0=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/install.sh b/install.sh index e5fd0f4..8fea79e 100644 --- a/install.sh +++ b/install.sh @@ -23,6 +23,33 @@ NC='\033[0m' log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; } log_error() { echo -e "${RED}[ERROR]${NC} $1"; } +full_uninstall() { + echo -e "${YELLOW}[INFO]${NC} Начинаем полное удаление LAMP-окружения..." + + systemctl stop nginx apache2 httpd php*-fpm mariadb mysql redis 2>/dev/null || true + + if [ "$DISTRO_FAMILY" = "debian" ]; then + apt purge -y nginx* apache2* php* mariadb* mysql* redis* 2>/dev/null || true + apt autoremove -y 2>/dev/null || true + else + $PKG_MANAGER remove -y nginx httpd php* mariadb* mysql* redis* 2>/dev/null || true + fi + + rm -rf \ + /etc/nginx \ + /etc/apache2 \ + /etc/httpd \ + /etc/php* \ + /var/www/html/* \ + /var/lib/mysql* \ + /var/lib/redis* \ + ~/.mysql_history \ + /root/.mysql_history 2>/dev/null || true + + echo -e "${GREEN}[SUCCESS]${NC} Полное удаление завершено!" + exit 0 +} + if [[ $EUID -ne 0 ]]; then log_error "Запустите этот скрипт вместе с sudo." exit 1 @@ -55,33 +82,6 @@ if [ "$UNINSTALL" = true ]; then full_uninstall fi -full_uninstall() { - echo -e "${YELLOW}[INFO]${NC} Начинаем полное удаление LAMP-окружения..." - - systemctl stop nginx apache2 httpd php*-fpm mariadb mysql redis 2>/dev/null || true - - if [ "$DISTRO_FAMILY" = "debian" ]; then - apt purge -y nginx* apache2* php* mariadb* mysql* redis* 2>/dev/null || true - apt autoremove -y 2>/dev/null || true - else - $PKG_MANAGER remove -y nginx httpd php* mariadb* mysql* redis* 2>/dev/null || true - fi - - rm -rf \ - /etc/nginx \ - /etc/apache2 \ - /etc/httpd \ - /etc/php* \ - /var/www/html/* \ - /var/lib/mysql* \ - /var/lib/redis* \ - ~/.mysql_history \ - /root/.mysql_history 2>/dev/null || true - - echo -e "${GREEN}[SUCCESS]${NC} Полное удаление завершено!" - exit 0 -} - systemctl stop nginx httpd apache2 php*-fpm 2>/dev/null || true systemctl disable nginx httpd 2>/dev/null || true