-
Notifications
You must be signed in to change notification settings - Fork 1
/
its-ai-rpi3-hassos.sh
60 lines (51 loc) · 1.46 KB
/
its-ai-rpi3-hassos.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
#!/bin/bash
RED="\033[1;31m"
GREEN="\033[1;32m"
NOCOLOR="\033[0m"
mylog() {
STEP=$1
MSG=$2
echo -e "step $STEP: ${GREEN}${MSG}${NOCOLOR}"
logger "step $STEP: $MSG"
}
myfail() {
STEP=$1
MSG=$2
echo -e "step $STEP ERROR: ${RED}${MSG}${NOCOLOR}"
logger "step $STEP ERROR: $MSG"
}
# handle command line options
if [[ $1 == "-h" ]]; then
echo "usage: $0"
echo " -h prints help"
exit 1
fi
# step 1
mylog 1 "installing docker kodi container"
if [ ! -d "/config/docker" ];
then
mkdir /config/docker
else
echo "docker directory already exist. nothing to do."
sleep 5
fi
if [ ! -d "/config/docker/kodi" ];
then
mkdir /config/docker/kodi
else
echo "kodi container directory already exist. nothing to do."
sleep 5
fi
if [ ! -d "/config/docker/kodi/.kodi" ];
then
mkdir /config/docker/kodi/.kodi
else
echo "kodi data directory already exist. nothing to do."
sleep 5
fi
cd /config/docker/kodi && { curl -O https://raw.githubusercontent.com/lpt2007/its-ai/master/apps-hassos-addons/kodi/Dockerfile ; cd -; }
cd /config/docker/kodi && { curl -O https://raw.githubusercontent.com/lpt2007/its-ai/master/apps-hassos-addons/kodi/config.json ; cd -; }
cd /config/docker/kodi && { curl -O https://raw.githubusercontent.com/lpt2007/its-ai/master/apps-hassos-addons/kodi/run.sh ; cd -; }
if [[ $? == 0 ]]; then
myfail 3 "nothing really"
fi