-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinstall.sh
75 lines (57 loc) · 1.22 KB
/
install.sh
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
#!/bin/bash
distro_id=`grep ^ID= /etc/os-release | awk -F= '{print $2}'|sed -e 's/"//g'`
case $distro_id in
centos)
sudo ./docker-install-centos.sh
;;
fedora)
sudo ./docker-install-fedora.sh
;;
debian)
sudo ./docker-install-debian.sh
;;
ubuntu)
sudo ./docker-install-ubuntu.sh
;;
*)
echo "not supported distro"
;;
esac
echo
echo
echo
echo
echo
echo
echo -n "Enter main url (i.e. - http://example.com, use https if tls is required): "
read url
delimiter="://"
string=$url$delimiter
myarray=()
while [[ $string ]]; do
myarray+=( "${string%%"$delimiter"*}" )
string=${string#*"$delimiter"}
done
echo -n "enter admin email: "
read email
echo -n "enter admin password: "
read password
cp env.example .env
sed -i '/SR_PROTO=/d' ./.env
sed -i '/SR_HOST=/d' ./.env
sed -i '/ADMIN_EMAIL=/d' ./.env
sed -i '/ADMIN_PASSWORD=/d' ./.env
sed -i '/APP_URL=/d' ./.env
echo "SR_PROTO=${myarray[0]}" >> ./.env
echo "SR_HOST=${myarray[1]}" >> ./.env
echo "ADMIN_EMAIL=${email}" >> ./.env
echo "ADMIN_PASSWORD=${password}" >> ./.env
echo "APP_URL=\"\${SR_PROTO}://\${SR_HOST}\"" >> ./.env
chmod 777 .env
sudo /usr/local/sbin/docker-compose up -d
echo
echo
echo
echo
echo
echo "Setup complete. Happy usage ;)"