wildduck/setup/02_install_prerequisites.sh
BUNYEVACZ Sandor 88ee4c9ede Breaking up install.sh into chapters
Fixed two issues:
82: need to install npm globally to get around permission problems
83: need to start nginx service before restarting it

Better executable requirements (lsof, ps). It may be not installed
on minimal systems.

Better service detection on given port. It is especially useful,
if the installation.sh got interrupted for some reason, and
already installed some services.

Minor doc update, so a single line is required to paste in terminal.
curl vs. wget -> stayed with wget, it is installed by default on ubuntu

Colors: added color support for the terminal output:)
2018-06-08 08:56:41 +02:00

38 lines
1.3 KiB
Bash

#! /bin/bash
OURNAME=02_install_prerequisites.sh
# No $AUT_SAFETY variable present, so we have not sourced install_variables.sh yet
if [ -z ${AUT_SAFETY+x} ]
then
echo "this script ${RED}called directly${NC}, and not from the main ./install.sh script"
echo "initializing common variables ('install_variables.sh')"
source "$INSTALLDIR/install_variables.sh"
fi
echo -e "\n-- Executing ${ORANGE}${OURNAME}${NC} subscript --"
echo -e "Checking ${YELLOW}lsof${NC}"
PROGRAM_LSOF=`command -v lsof`
if ! [ -x "$PROGRAM_LSOF" ]; then
echo -e "${RED}ERROR:${NC} lsof is not installed."
echo "to know which package contains the particular executable, launch:"
echo "dpkg -S lsof |grep lsof$ # on ubuntu/debian variants"
echo -e "Launching for you:\n"
echo -e "`dpkg -S lsof | grep /lsof$`"
echo -e "\nOn ubuntu 16.04 it is: ${GREEN}apt install lsof${NC}"
fi
echo -e "Checking ${YELLOW}ps${NC}"
PROGRAM_PS=`command -v ps`
if ! [ -x "$PROGRAM_PS" ]; then
echo -e "${RED}ERROR:${NC} ps is not installed."
echo "to know which package contains the particular executable, launch:"
echo "dpkg -S ps |grep ps$ # on ubuntu/debian variants"
echo -e "Launching for you:\n"
echo -e "`dpkg -S ps | grep /ps$`"
echo -e "\nOn ubuntu 16.04 it is: ${GREEN}apt install procps${NC}"
fi