-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
49 lines (38 loc) · 1.12 KB
/
run.sh
File metadata and controls
49 lines (38 loc) · 1.12 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
#!/usr/bin/env bash
set -e
#support both bash and hassio env variables
#environment variable check
CONFIG_PATH=/data/options.json
#if config file exists, use this
if [ -f $CONFIG_PATH ]; then
ACCESS_TOKEN=$(jq --raw-output '.ACCESS_TOKEN // "'${ACCESS_TOKEN}'"' $CONFIG_PATH)
REPO_URL=$(jq --raw-output '.REPO_URL // "'${REPO_URL}'"' $CONFIG_PATH)
#for home assistant import local variables
export ACCESS_TOKEN
export REPO_URL
else
echo "No config file found, using environment variables"
fi
echo "ACCESS_TOKEN: $ACCESS_TOKEN"
echo "REPO_URL: $REPO_URL"
if [ -z "$ACCESS_TOKEN" ]; then
echo "ACCESS_TOKEN is required"
exit 1
fi
if [ -z "$REPO_URL" ]; then
echo "REPO_URL is required"
exit 1
fi
# if robocus folder exists, copy to /var/www/html
if [ -d "/share/robocus" ]; then
cp -r /share/robocus/* /var/www/html
echo "copied robocus to /var/www/html"
else
mkdir -p /share/robocus]
echo "created robocus"
fi
#excute /entrypoint.sh
echo "Starting entrypoint.sh"
bash /entrypoint.sh
echo "Starting runner"
./bin/Runner.Listener run --startuptype service & nginx -g 'daemon off;'