nginx.sh updated
This commit is contained in:
parent
da94961fc1
commit
274bd3549c
1 changed files with 18 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue