#!/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