From 28d4113a528b2b904a427bbb5b618071a77cab60 Mon Sep 17 00:00:00 2001 From: kyle Date: Wed, 31 Dec 2025 04:26:26 -0800 Subject: [PATCH] Add configure-ha-url.sh --- configure-ha-url.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 configure-ha-url.sh diff --git a/configure-ha-url.sh b/configure-ha-url.sh new file mode 100644 index 0000000..37ec6d9 --- /dev/null +++ b/configure-ha-url.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Helper script to configure Home Assistant URL + +CONFIG_FILE="$HOME/scripts/homeassistant-dashboard.sh" + +echo "Home Assistant Dashboard URL Configuration" +echo "==========================================" +echo "" +echo "Current URL in script:" +grep "HA_URL=" "$CONFIG_FILE" | head -1 +echo "" +echo "Enter your Home Assistant URL (e.g., http://192.168.1.100:8123)" +echo "Or press Enter to keep current setting:" +read -r NEW_URL + +if [ -n "$NEW_URL" ]; then + # Remove trailing slash if present + NEW_URL="${NEW_URL%/}" + + # Update the script + sed -i "s|HA_URL=\"\${HA_URL:-.*}\"|HA_URL=\"\${HA_URL:-$NEW_URL}\"|" "$CONFIG_FILE" + echo "" + echo "✓ URL updated to: $NEW_URL" + echo "" + echo "The dashboard will use this URL on next login/restart." + echo "To test it now, run: ~/scripts/homeassistant-dashboard.sh" +else + echo "No changes made." +fi