#!/bin/bash set -e if [ -z "$AUTH_ID" ]; then echo "Error: AUTH_ID is required" exit 1 fi if [ -z "$USER" ]; then echo "Error: USER is required" exit 1 fi NAMESPACE=$(cat manifest.yaml | grep 'namespace:' | head -1 | awk '{print $2}') echo "Registering node for user '$USER' with auth ID: $AUTH_ID" kubectl exec -n "$NAMESPACE" deploy/headscale -- \ headscale auth register --auth-id "$AUTH_ID" --user "$USER"