-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·99 lines (96 loc) · 2.59 KB
/
build.sh
File metadata and controls
executable file
·99 lines (96 loc) · 2.59 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
source includes/functions.sh
# This line MUST be present in all scripts executed by cron!
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
## PARAMETERS
RED='\e[0;31m'
GREEN='\033[0;32m'
BLUEDARK='\033[0;34m'
BLUE='\e[0;36m'
YELLOW='\e[0;33m'
BWHITE='\e[1;37m'
NC='\033[0m'
DATE=`date +%d/%m/%Y-%H:%M:%S`
BACKUPDATE=`date +%d-%m-%Y-%H-%M-%S`
IPADDRESS=$(ip a | grep eth0 | awk '/inet /{print substr($2,1)}' | cut -d\/ -f1)
FIRSTPORT="5050"
LASTPORT="8080"
CONFDIR="/etc/seedboxcompose"
DOCKERLIST="/etc/apt/sources.list.d/docker.list"
SERVICESAVAILABLE="includes/config/services-available"
SERVICES="includes/config/services"
SERVICESOK="/etc/seedboxcompose/services-$SEEDUSER"
FILEPORTPATH="/etc/seedboxcompose/ports.pt"
INSTALLEDFILE="/etc/seedboxcompose/installed.ok"
DOCKERCOMPOSEFILE="/etc/seedboxcompose/docker-compose.yml"
INFOLOGS="/var/log/seedboxcompose.info.log"
ERRORLOGS="/var/log/seedboxcompose.error.log"
clear
if [ $USER = "root" ] ; then
## Display script infos
intro
## Check option for script lauching
script_option
case $SCRIPT in
"INSTALL")
if [[ ! -d "/etc/seedboxcompose/" ]]; then
echo -e "${BLUE}##########################################${NC}"
echo -e "${BLUE}### INSTALLING SEEDBOX-COMPOSE ###${NC}"
echo -e "${BLUE}##########################################${NC}"
conf_dir
## Install base packages
install_base_packages
## Upgrading system
upgrade_system
## Check for docker on system
install_docker
## Installing base packages
base_packages
## Check for LetsEncrypt packages on system
install_letsencrypt
## Defines parameters for dockers : password, domains and replace it in docker-compose file
define_parameters
## Choose wich services install
choose_services
## Update docker-compose file
install_services
## Generate dockers apps running in background
docker_compose
## Create reverse proxy for each apps
create_reverse
## Validating Htpasswd
valid_htpasswd
## Resuming seedbox-compose installation
resume_seedbox
## Backup dockers app Configuration
backup_docker_conf
## Display Teamspeak IDs
access_token_ts
else
clear
echo -e " ${RED}--> Seedbox-Compose already installed !${NC}"
script_option
fi
;;
"ADDUSER")
add_user_htpasswd
;;
"DELETEHTACCESS")
delete_htaccess
;;
"ADDDOCKAPP")
echo ""
;;
"NEWSEEDBOXUSER")
new_seedbox_user
;;
"RESTARTDOCKER")
restart_docker_apps
;;
"DELETEDOCKERS")
delete_dockers
;;
"BACKUPCONF")
backup_docker_conf
esac
fi