forked from grimmpp/home-assistant-eltako
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_custom_component_eltako.sh
More file actions
executable file
·43 lines (32 loc) · 1.08 KB
/
install_custom_component_eltako.sh
File metadata and controls
executable file
·43 lines (32 loc) · 1.08 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
#!/bin/bash
# Install from outside. Copy file and run it in HA.
# Function to display commands
exe() { echo "\$ ${@/eval/}" ; "$@" ; }
echo -e "\nInstall custom component for Eltako Baureihe 14\n"
repo_name="home-assistant-eltako"
if [[ $(pwd) != *"$repo_name"* ]]; then
repo_name="https://github.com/grimmpp/home-assistant-eltako.git"
echo -e "Download repository $repo_name"
exe git clone $repo_name
else
exe git pull
fi
custom_components="/root/config/custom_components"
eltako_dir="$custom_components/eltako"
if [ -d "$eltako_dir" ]; then
echo -e "\nDelete directory $eltako_dir"
exe rm -r $eltako_dir
fi
repo_dir=""
if [[ $(pwd) != *"$repo_name"* ]]; then
repo_dir="/home-assistant-eltako"
fi
echo -e "\nCopy new folder into $eltako_dir"
exe mkdir -p $eltako_dir
exe cp -r .$repo_dir/custom_components/eltako $custom_components
#echo -e "\nRemove leftovers from repo home-assistant-eltko"
#exe rm -r .$repo_dir
echo -e "\nRestart home assistant"
exe ha core restart
echo -e "\nDone!"
echo -e "\nYou could delete folder git repository: home-assistant-eltako"