From 9ba1e537ab80cff180add1e25935bbe94733dd5f Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 9 Dec 2021 06:57:15 +0100 Subject: [PATCH] Update automatic_packages.sh --- zzz_templates/automatic_packages.sh | 33 ++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/zzz_templates/automatic_packages.sh b/zzz_templates/automatic_packages.sh index 395d1b0c1..2d573f49a 100644 --- a/zzz_templates/automatic_packages.sh +++ b/zzz_templates/automatic_packages.sh @@ -81,13 +81,9 @@ for files in "/scripts" "/etc/cont-init.d"; do [ $PACKMANAGER = "apt" ] && PACKAGES="$PACKAGES sqlite3" fi - if [[ $(grep -rnw "$files/" -e 'lastversion') ]]; then - [ $PACKMANAGER = "apk" ] && [[ $(pip -V) ]] \ - || apk add --no-cache py3-pip \ - && pip install lastversion - [ $PACKMANAGER = "apt" ] && [[ $(pip -V) ]] \ - || apt-get install -y python-pip \ - && pip install lastversion + if [[ $(grep -rnw "$files/" -e 'pip') ]] && [[ ! $(pip -V) ]]; then + [ $PACKMANAGER = "apk" ] && PACKAGES="$PACKAGES py3-pip" + [ $PACKMANAGER = "apt" ] && PACKAGES="$PACKAGES python-pip" fi done @@ -106,12 +102,29 @@ if [ -d /etc/nginx2 ]; then touch /var/log/nginx/error.log fi -################## -# INSTALL BASHIO # -################## +####################### +# INSTALL MANUAL APPS # +####################### +for files in "/scripts" "/etc/cont-init.d"; do + +# Bashio + if [[ $(grep -rnw "$files/" -e 'bashio') ]]; then mkdir -p /tmp/bashio curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | tar -xzf - --strip 1 -C /tmp/bashio mv /tmp/bashio/lib /usr/lib/bashio ln -s /usr/lib/bashio/bashio /usr/bin/bashio rm -rf /tmp/bashio + fi + +# Lastversion + if [[ $(grep -rnw "$files/" -e 'lastversion') ]]; then + [ $PACKMANAGER = "apk" ] && [[ $(pip -V) ]] \ + || apk add --no-cache py3-pip \ + && pip install lastversion + [ $PACKMANAGER = "apt" ] && [[ $(pip -V) ]] \ + || apt-get install -y python-pip \ + && pip install lastversion + fi + +fi