-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·50 lines (40 loc) · 1.2 KB
/
start.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
#!/bin/bash
if [ "$EUID" == 0 ]; then
echo "Do not run as root"
exit 1
fi
if [ ! -f "./.env" ]; then
echo "Run ./setup.sh first"
exit 1
fi
source ./.env
#Get out of the scripts directory
if [ "$(basename "$(dirname "$PWD")")" = "scripts" ]; then
cd ..
fi
#Start
echo -e "\nStarting"
docker compose --profile apps up -d
#Generate home page
cp ./web/index.html.template ./web/index.html
# Check if plex claim token was set
if [ -n "$PLEX_CLAIM" ]; then
docker compose up plex -d
else
sed -i '/#video {/{N;s/display: block;/display: none;/}' ./web/index.html # Disable panel on homepage
fi
# Check if ./vpn.conf exists to run download managers
if [ "$ENABLE_DOWNLOADERS" = "1" ]; then
docker compose --profile downloaders up -d
else
sed -i '/#download_managers {/{N;s/display: block;/display: none;/}' ./web/index.html # Disable panel on homepage
fi
sed -i "s/\${INTERNAL_DOMAIN}/${INTERNAL_DOMAIN}/g" ./web/index.html
sed -i "s/\${EXTERNAL_DOMAIN}/${EXTERNAL_DOMAIN}/g" ./web/index.html
sed -i "s/\${HOST_IP}/${HOST_IP}/g" ./web/index.html
echo -e "\nIndex.html created"
if [ "$IN_SETUP" != "1" ]; then
# Show home page
echo -e "\nklack.cloud launched!"
echo -e "\nFinish setup at http://$HOST_IP"
fi