Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This adds support for all OSes supported by Homegear at the moment
  • Loading branch information
lfrancke committed Dec 22, 2017
1 parent 17aa7d1 commit 256d4cb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
16 changes: 16 additions & 0 deletions functions/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,23 @@ is_debian() {
[[ $(lsb_release -d) =~ "Debian" ]]
return $?
}
is_raspbian() {
[[ "$(lsb_release -si)" = "Raspbian" ]]
return $?
}
is_jessie() {
[[ $(lsb_release -c) =~ "jessie" ]]
return $?
}
is_stretch() {
[[ $(lsb_release -sc) =~ "stretch" ]]
return $?
}
is_trusty() {
[[ $(lsb_release -sc) =~ "trusty" ]]
return $?
}
is_xenial() {
[[ $(lsb_release -sc) =~ "xenial" ]]
return $?
}
28 changes: 27 additions & 1 deletion functions/packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,33 @@ To continue your integration in openHAB 2, please follow the instructions under:
fi

cond_redirect wget -O - http://homegear.eu/packages/Release.key | apt-key add -
echo "deb https://homegear.eu/packages/Raspbian/ jessie/" > /etc/apt/sources.list.d/homegear.list

distro="$(lsb_release -si)-$(lsb_release -sc)"
case "$distro" in
Debian-jessie)
echo 'deb https://apt.homegear.eu/Debian/ jessie/' >> /etc/apt/sources.list.d/homegear.list
;;
Debian-stretch)
echo 'deb https://apt.homegear.eu/Debian/ stretch/' >> /etc/apt/sources.list.d/homegear.list
;;
Raspbian-jessie)
echo 'deb https://apt.homegear.eu/Raspbian/ jessie/' >> /etc/apt/sources.list.d/homegear.list
;;
Raspbian-stretch)
echo 'deb https://apt.homegear.eu/Raspbian/ stretch/' >> /etc/apt/sources.list.d/homegear.list
;;
Ubuntu-trusty)
echo 'deb https://apt.homegear.eu/Ubuntu/ trusty/' >> /etc/apt/sources.list.d/homegear.list
;;
Ubuntu-xenial)
echo 'deb https://apt.homegear.eu/Ubuntu/ xenial/' >> /etc/apt/sources.list.d/homegear.list
;;
*)
echo "Your OS is not supported"
exit 1
;;
esac

cond_redirect apt update
if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
cond_redirect apt -y install homegear homegear-homematicbidcos homegear-homematicwired
Expand Down

0 comments on commit 256d4cb

Please sign in to comment.