#!/bin/sh # --------------------------------------------------------------------------- # Uninstall from your HA device's terminal: # # curl -fsSL https://aevocam.com/ha-unins | sh # # --------------------------------------------------------------------------- set -eu COMPONENT_NAME="aevocam" echo echo "Aevocam Home Assistant Integration Uninstaller" echo "===============================================" echo # --------------------------------------------------------------------------- # Locate the Home Assistant configuration directory. # # Typical environments: # # Home Assistant OS host: # /mnt/data/supervisor/homeassistant # # Terminal/SSH add-on or similar environment: # /config # --------------------------------------------------------------------------- if [ -f "/config/configuration.yaml" ]; then HA_CONFIG="/config" elif [ -f "/mnt/data/supervisor/homeassistant/configuration.yaml" ]; then HA_CONFIG="/mnt/data/supervisor/homeassistant" else echo "ERROR: Could not locate the Home Assistant configuration directory." echo echo "Expected to find configuration.yaml in one of:" echo echo " /config" echo " /mnt/data/supervisor/homeassistant" echo echo "If your Home Assistant configuration is stored elsewhere," echo "this uninstaller cannot currently detect it automatically." exit 1 fi echo "Home Assistant configuration:" echo " $HA_CONFIG" echo CUSTOM_COMPONENTS="$HA_CONFIG/custom_components" INSTALL_DIR="$CUSTOM_COMPONENTS/$COMPONENT_NAME" STAGING_DIR="$CUSTOM_COMPONENTS/.aevocam-installing" OLD_DIR="$CUSTOM_COMPONENTS/.aevocam-old" # Leftover from older installer versions. LEGACY_BACKUP_DIR="$CUSTOM_COMPONENTS/aevocam.backup" REMOVED_ANY=0 if [ -d "$INSTALL_DIR" ]; then echo "Removing:" echo " $INSTALL_DIR" rm -rf "$INSTALL_DIR" REMOVED_ANY=1 fi if [ -d "$STAGING_DIR" ]; then echo "Removing leftover install staging:" echo " $STAGING_DIR" rm -rf "$STAGING_DIR" REMOVED_ANY=1 fi if [ -d "$OLD_DIR" ]; then echo "Removing leftover previous install:" echo " $OLD_DIR" rm -rf "$OLD_DIR" REMOVED_ANY=1 fi if [ -d "$LEGACY_BACKUP_DIR" ]; then echo "Removing leftover installer backup:" echo " $LEGACY_BACKUP_DIR" rm -rf "$LEGACY_BACKUP_DIR" REMOVED_ANY=1 fi echo if [ "$REMOVED_ANY" -eq 0 ]; then echo "No Aevocam installation found under:" echo " $CUSTOM_COMPONENTS" echo echo "Nothing to uninstall." exit 0 fi sync echo "Aevocam files removed." echo echo "Next:" echo echo " 1. Open Settings -> Devices & services." echo " 2. If Aevocam is still listed, select it and choose Delete." echo " 3. Restart Home Assistant." echo