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
|
#!/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
|
### DEPENDENCY CHECK
|
||||||
|
|
||||||
bin="openssl"
|
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
|
if (( $(id -u) == 0 )); then
|
||||||
echo -e "Privilege check passed...\n"
|
echo -e "${GRN}Privilege check passed...${CRS}\n"
|
||||||
|
|
||||||
else
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v "$bin" >/dev/null 2>&1; then
|
if command -v "$bin" >/dev/null 2>&1; then
|
||||||
echo -e "Dependency check passed...\n"
|
echo -e "${GRN}Dependency check passed...${CRS}\n"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo -e "$bin is not installed.\n"
|
echo -e "${YEL}$bin is not installed.${CRS}\n"
|
||||||
|
|
||||||
while true; do
|
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
|
if [[ "$install" = "" || "$install" = "y" || "$install" = "Y" ]]; then
|
||||||
sudo apt update && sudo apt install --install-suggests -y $bin
|
touch /tmp/lomesInstallLog.txt
|
||||||
echo -e "\n$bin installed. Proceeding...\n"
|
sudo apt update && sudo apt install --install-suggests -y $bin >/tmp/lomesInstallLog.txt
|
||||||
|
echo -e "\n${GRN}$bin installed. Proceeding...${CRS}\n"
|
||||||
break
|
break
|
||||||
|
|
||||||
elif [[ "$install" == "n" || "$install" = "N" ]]; then
|
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
|
exit 1
|
||||||
|
|
||||||
else
|
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
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue