#!/bin/sh # Wait for Technitium to be ready echo "Waiting for Technitium DNS to start..." while ! wget -q --spider http://localhost:5380/ 2>/dev/null; do sleep 2 done echo "Technitium is up, configuring..." # Login and get session curl -s -X POST http://localhost:5380/api/login \ -H "Content-Type: application/json" \ -d '{"username":"admin","password":"admin123"}' > /tmp/login.json if [ ! -f /tmp/login.json ]; then echo "Failed to login to Technitium" exit 1 fi # Create the zone 'space.test.rip' echo "Creating zone space.test.rip..." curl -s -X POST http://localhost:5380/api/zones/create \ -H "Content-Type: application/json" \ -d '{ "zone": "space.test.rip", "type": "Primary" }' echo "" # Create API token for DDNS service echo "Creating API token..." curl -s -X POST http://localhost:5380/api/user/createApiToken \ -H "Content-Type: application/json" \ -d '{ "username": "admin", "tokenName": "ddns-bridge", "token": "dns-api-token-12345" }' echo "" echo "Technitium initialization complete!"