From 274bd3549cde75af00e4652bd1ab5c8d9d7e11b2 Mon Sep 17 00:00:00 2001 From: Fr4nz D13trich Date: Wed, 8 Oct 2025 12:16:52 +0200 Subject: [PATCH] nginx.sh updated --- assets/shell/create_certificate.sh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/assets/shell/create_certificate.sh b/assets/shell/create_certificate.sh index 1e0ff34..311910f 100755 --- a/assets/shell/create_certificate.sh +++ b/assets/shell/create_certificate.sh @@ -1,39 +1,47 @@ #!/bin/bash +## SOME COLOR +CYN="\e[0;36m" +YEL="\e[0;33m" +RED="\e[0;31m" +GRN="\e[0;32m" +CRS="\e[0m" + ### DEPENDENCY CHECK bin="openssl" -echo -e "\nDependency and Privilege Check running...\n" +echo -e "\n${CYN}Dependency and Privilege Check running...${CRS}\n" if (( $(id -u) == 0 )); then - echo -e "Privilege check passed...\n" + echo -e "${GRN}Privilege check passed...${CRS}\n" else - echo -e "Privilege check failed... Please run script with sudo or as root!\n" + echo -e "${RED}Privilege check failed... Please run script with sudo or as root!${CRS}\n" exit 1 fi if command -v "$bin" >/dev/null 2>&1; then - echo -e "Dependency check passed...\n" + echo -e "${GRN}Dependency check passed...${CRS}\n" else - echo -e "$bin is not installed.\n" + echo -e "${YEL}$bin is not installed.${CRS}\n" while true; do - read -p "Do you wish to install $bin via APT? (Y/n) : " install + read -p "${YEL}Do you wish to install $bin via APT? (Y/n) : " install if [[ "$install" = "" || "$install" = "y" || "$install" = "Y" ]]; then - sudo apt update && sudo apt install --install-suggests -y $bin - echo -e "\n$bin installed. Proceeding...\n" + touch /tmp/lomesInstallLog.txt + sudo apt update && sudo apt install --install-suggests -y $bin >/tmp/lomesInstallLog.txt + echo -e "\n${GRN}$bin installed. Proceeding...${CRS}\n" break elif [[ "$install" == "n" || "$install" = "N" ]]; then - echo -e "\nDependencies not installed... Exiting\n" + echo -e "\n${RED}Dependencies not installed... Exiting!${CRS}\n" exit 1 else - echo -e "\nInvalid response... Try again...\n\nY = (Yes, install $bin)\nN = (No, don't install dependencies and exit)\n " + echo -e "\n${YEL}Invalid response... Try again...\n\nY = (Yes, install $bin)\nN = (No, don't install dependencies and exit)${CRS}\n " fi done fi