Files
vm-skills/cloudflare-tunnel-manager/scripts/rollback/undo_tunnel.sh
Vault Sovereign eac77ef7b4 Initial commit: VaultMesh Skills collection
Collection of operational skills for VaultMesh infrastructure including:
- backup-sovereign: Backup and recovery operations
- btc-anchor: Bitcoin anchoring
- cloudflare-tunnel-manager: Cloudflare tunnel management
- container-registry: Container registry operations
- disaster-recovery: Disaster recovery procedures
- dns-sovereign: DNS management
- eth-anchor: Ethereum anchoring
- gitea-bootstrap: Gitea setup and configuration
- hetzner-bootstrap: Hetzner server provisioning
- merkle-forest: Merkle tree operations
- node-hardening: Node security hardening
- operator-bootstrap: Operator initialization
- proof-verifier: Cryptographic proof verification
- rfc3161-anchor: RFC3161 timestamping
- secrets-vault: Secrets management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 00:25:00 +00:00

29 lines
961 B
Bash

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SKILL_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
source "$SKILL_ROOT/scripts/_common.sh"
: "${TUNNEL_NAME:=}"
: "${CONFIG_DIR:=$SKILL_ROOT/outputs/config}"
main() {
confirm_gate
[[ -n "$TUNNEL_NAME" ]] || die "TUNNEL_NAME is required."
if [[ -f "$CONFIG_DIR/tunnel.json" ]]; then
local tunnel_id; tunnel_id="$(jq -r '.id' "$CONFIG_DIR/tunnel.json")"
if [[ -n "$tunnel_id" && "$tunnel_id" != "null" ]]; then
log_warn "Deleting tunnel via cloudflared: $TUNNEL_NAME ($tunnel_id)"
cloudflared tunnel delete -f "$tunnel_id" || cloudflared tunnel delete -f "$TUNNEL_NAME" || true
fi
else
log_warn "No tunnel.json snapshot; attempting delete by name: $TUNNEL_NAME"
cloudflared tunnel delete -f "$TUNNEL_NAME" || true
fi
rm -f "$CONFIG_DIR/tunnel.json" "$CONFIG_DIR/config.yml" || true
log_info "Tunnel rollback complete."
}
main "$@"