From c375d83e4a3b85e904c5b31a943888b320c52b98 Mon Sep 17 00:00:00 2001 From: kosenka Date: Mon, 1 Sep 2025 22:44:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=202-install.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2-install.sh | 71 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/2-install.sh b/2-install.sh index c03171d..0e89b45 100644 --- a/2-install.sh +++ b/2-install.sh @@ -60,7 +60,7 @@ gen_pass() { # Функция отображает запрос и ждет ответа function confirm() { while true; do - read -p "$1? (y/n) " yn + read -p "$1 ? (y/n) " yn case $yn in [Yy]* ) return 0;; [Nn]* ) return 1;; @@ -327,37 +327,54 @@ main() { apt-get -qq install -y libreoffice-core --no-install-recommends libreoffice-writer default-jre libreoffice-java-common apt-get -qq install -y gnupg2 apt-transport-https software-properties-common - control sudowheel enabled - - # Вызов функций установки - install_user - install_angie - create_site - install_postgresql - install_fail2ban - install_php_fpm - #install_freetds - systemctl enable memcached systemctl start memcached - mkdir /mnt/FOTOSVID - echo "[Unit] -Description=Mount SMB share -After=network.target -Wants=network.target + control sudowheel enabled -[Service] -Type=oneshot -ExecStartPre=sleep 15 -ExecStart=/bin/mount -t cifs //10.77.1.250/FOTOSVID /mnt/FOTOSVID -o username=fotosvid,password=$FOTOSVIDPASS,rw,file_mode=0666,dir_mode=0777 + install_fail2ban -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mnt-fotosvid.service - systemctl daemon-reload - systemctl enable mnt-fotosvid.service - systemctl start mnt-fotosvid.service + # Вызов функций установки + if confirm "Install user "; then + install_user + fi + + if confirm "Install Angie "; then + install_angie + create_site + fi + + if confirm "Install PostgreSQL "; then + install_postgresql + fi + + if confirm "Install PHP "; then + install_php_fpm + fi + + if confirm "Install FreeTDS "; then + install_freetds + fi + + if confirm "Install FOTOSVID "; then + mkdir /mnt/FOTOSVID + echo "[Unit] + Description=Mount SMB share + After=network.target + Wants=network.target + + [Service] + Type=oneshot + ExecStartPre=sleep 15 + ExecStart=/bin/mount -t cifs //10.77.1.250/FOTOSVID /mnt/FOTOSVID -o username=fotosvid,password=$FOTOSVIDPASS,rw,file_mode=0666,dir_mode=0777 + + [Install] + WantedBy=multi-user.target + " > /etc/systemd/system/mnt-fotosvid.service + systemctl daemon-reload + systemctl enable mnt-fotosvid.service + systemctl start mnt-fotosvid.service + fi echo "[ * ] Установка завершена!" echo "Проверьте службы:"