forked from therubyshore/bootstrap-debian-10
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart
executable file
·35 lines (29 loc) · 1.01 KB
/
start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
END_COLOR='\033[0m' # No Color
echo "Checking OS version..."
if [ "$(grep -Ei 'VERSION_ID="11"' /etc/os-release)" ] && [ "$(grep -Ei 'ID=debian' /etc/os-release)" ]; then
printf "${GREEN}$(cat /etc/os-release)${END_COLOR}\n"
echo "Compatible! Proceeding..."
else
printf "${RED}$(cat /etc/os-release)${END_COLOR}\n"
echo "Incompatible os release! Debian 10 required. Exiting."
exit 1
fi
all_hostnames=$@
main_hostname=$1
if ! [[ $main_hostname == *"."* ]]; then
echo "$main_hostname does not appear to be a valid hostname."
exit 1
fi
./idempotent-scripts/install-dependencies
sudo ./idempotent-scripts/set-hostname $main_hostname
./idempotent-scripts/environment-conf
sudo ./idempotent-scripts/create-swapfile
./idempotent-scripts/install-config-files
sudo ./idempotent-scripts/set-up-nginx $all_hostnames
./idempotent-scripts/set-up-certbot $all_hostnames
./idempotent-scripts/set-up-docker
echo "Successfully bootstrapped."
echo "Please restart $main_hostname."