Skip to content

Instantly share code, notes, and snippets.

@chingcp26
chingcp26 / 01-get-token.sh
Created April 3, 2026 21:02
Skyhome Daikin API test scripts (away + schedule)
#!/bin/bash
# Get both tokens (integrator + consumer)
set -euo pipefail
DIR="$(dirname "$0")"
# Clear existing tokens to force refresh
sed -i '' 's|^INTEGRATOR_ACCESS_TOKEN=.*|INTEGRATOR_ACCESS_TOKEN=""|' "${DIR}/.env"
sed -i '' 's|^CONSUMER_ACCESS_TOKEN=.*|CONSUMER_ACCESS_TOKEN=""|' "${DIR}/.env"
source "${DIR}/lib.sh"