#!/bin/bash # Test script to demonstrate Zion default peer feature set -e # Colors for output GREEN='\033[0;32m' BLUE='\033[0;34m' NC='\033[0m' print_status() { echo -e "${GREEN}[INFO]${NC} $1" } print_header() { echo -e "${BLUE}================================${NC}" echo -e "${BLUE}$1${NC}" echo -e "${BLUE}================================${NC}" } print_header "Testing Zion Default Peer Feature" echo "This test will create a client configuration with Zion as the default peer." echo "The script will automatically include Zion's connection details." echo "" # Create test input for a client configuration cat > /tmp/test_zion_input.txt << 'EOF' test_client 10.8.0.5/24 n y n EOF print_status "Running setup script with test configuration..." echo "Input will be:" echo " Node name: test_client" echo " IP: 10.8.0.5/24" echo " Server mode: n (no)" echo " Add Zion: y (yes)" echo " Add additional peers: n (no)" echo "" # Run the setup script ./wireguard_setup.sh < /tmp/test_zion_input.txt # Clean up rm -f /tmp/test_zion_input.txt print_status "Test completed! Check wireguard_configs/test_client.conf" echo "" echo "The generated configuration should include Zion as a peer with:" echo " Public Key: 2ztJbrN1x1NWanzPGLiKL19ZkdOhm5Y7WeKEWBT5cyg=" echo " Endpoint: ugh.im:51820" echo " Allowed IPs: 10.8.0.0/24" echo " Persistent Keepalive: 25"