74 lines
2.1 KiB
Bash
Executable File
74 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
toolName=mytool
|
|
|
|
# Get script working directory
|
|
# (when called from a different directory)
|
|
WDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >>/dev/null 2>&1 && pwd )"
|
|
#CONFIG=0
|
|
#CONFIG_FILE_NAME="${toolName}.cfg"
|
|
#CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
|
|
|
#step_config() {
|
|
#echo "Called once before executing steps."
|
|
## e.g. to source a config file manually:
|
|
#. "$CONFIG_FILE"
|
|
## or to use sequencer api:
|
|
#initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
|
#if [ $? -eq 0 ] ; then
|
|
# CONFIG=1
|
|
#fi
|
|
#}
|
|
|
|
step_1_info() { echo "Installation prerequisits"; }
|
|
step_1_alias() { ALIAS="prepare"; }
|
|
step_1() {
|
|
exe read -p "Make sure SSL certificates are available. Enter to continue"
|
|
exe apt install gnupg2 git lsb-release ssl-cert ca-certificates apt-transport-https \
|
|
tree locate software-properties-common dirmngr screen htop nano net-tools zip unzip \
|
|
curl ffmpeg ghostscript libfile-fcntllock-perl curl socat
|
|
}
|
|
|
|
step_2() {
|
|
apt-add-repository universe
|
|
exep "echo \"deb [arch=amd64] http://nginx.org/packages/mainline/ubuntu $(lsb_release -cs) nginx\" | tee /etc/apt/sources.list.d/nginx.list"
|
|
exep "curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -"
|
|
}
|
|
|
|
step_3() {
|
|
exep "echo \"deb https://download.jitsi.org stable/\" | tee /etc/apt/sources.list.d/jitsi.list"
|
|
exep "wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -"
|
|
}
|
|
|
|
step_4() {
|
|
exe apt update && apt upgrade
|
|
}
|
|
|
|
step_5_alias() { ALIAS="webserver"; }
|
|
step_5() {
|
|
exe apt install nginx
|
|
endReturn -o $? "Installation of webserver nginx failed"
|
|
exe mkdir -p /etc/nginx/sites-available
|
|
exe mkdir -p /etc/nginx/sites-enabled
|
|
exe mkdir -p /etc/nginx/modules-enabled
|
|
exe systemctl enable nginx.service
|
|
}
|
|
|
|
step_6_alias() { ALIAS="firewall"; }
|
|
step_6() {
|
|
exe apt install ufw
|
|
endReturn -o $? "Installation of firewall ufw failed"
|
|
}
|
|
|
|
step_7() {
|
|
exe ufw allow 22/tcp
|
|
exe ufw allow 80/tcp
|
|
exe ufw allow 443/tcp
|
|
exe ufw allow 4443/tcp
|
|
exe ufw allow 10000/udp
|
|
exe ufw logging medium && ufw default deny incoming && ufw enable && service ufw restart
|
|
}
|
|
|
|
VERSION_SEQREV=10
|
|
. /usr/local/bin/sequencer.sh
|