Add configure-ha-url.sh

This commit is contained in:
2025-12-31 04:26:26 -08:00
parent c40388b8a6
commit 28d4113a52

29
configure-ha-url.sh Normal file
View File

@@ -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