From 793ecba76493849c4ed5498ddcb5f3ff4f81f5e6 Mon Sep 17 00:00:00 2001 From: bahmcloud Date: Wed, 14 Jan 2026 17:38:47 +0000 Subject: [PATCH] =?UTF-8?q?bahmcloud=5Fstore=5Finstaller/run.sh=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bahmcloud_store_installer/run.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 bahmcloud_store_installer/run.sh diff --git a/bahmcloud_store_installer/run.sh b/bahmcloud_store_installer/run.sh new file mode 100644 index 0000000..76092ca --- /dev/null +++ b/bahmcloud_store_installer/run.sh @@ -0,0 +1,26 @@ +#!/bin/sh +set -e + +ZIP_URL="$(cat /data/options.json | sed -n 's/.*"store_component_zip"[ ]*:[ ]*"\([^"]*\)".*/\1/p')" +TARGET="/config/custom_components/bahmcloud_store" + +echo "Downloading: $ZIP_URL" +mkdir -p /tmp/storezip +curl -L --fail "$ZIP_URL" -o /tmp/storezip/store.zip + +rm -rf /tmp/storezip/extract +mkdir -p /tmp/storezip/extract +unzip -q /tmp/storezip/store.zip -d /tmp/storezip/extract + +SRC="$(find /tmp/storezip/extract -type d -path "*/custom_components/bahmcloud_store" | head -n 1)" +if [ -z "$SRC" ]; then + echo "ERROR: custom_components/bahmcloud_store not found in zip" + exit 1 +fi + +echo "Installing to: $TARGET" +rm -rf "$TARGET" +mkdir -p "$(dirname "$TARGET")" +cp -a "$SRC" "$TARGET" + +echo "Done. Please restart Home Assistant."