bahmcloud_store_installer/run.sh hinzugefügt
This commit is contained in:
26
bahmcloud_store_installer/run.sh
Normal file
26
bahmcloud_store_installer/run.sh
Normal file
@@ -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."
|
||||
Reference in New Issue
Block a user