Files
wp-agentic-writer/downloads/agentic-writer-local-backend/get-local-ip.sh
Dwindi Ramadhana d2c10756ab Add AI writing assistant plugin with local backend, brave search, and image generation support
- Implement local backend AI provider with Ollama integration
- Add Brave Search API integration for real-time search suggestions
- Add image generation manager with multiple AI providers
- Create hybrid provider system with local/cloud fallback
- Add comprehensive settings UI with provider management
- Implement Gutenberg sidebar with writing assistance controls
- Add SEO schema generation for AI-generated content
- Multiple provider support: OpenRouter, local backend, Codex
2026-05-17 10:48:05 +07:00

35 lines
1.1 KiB
Bash

#!/bin/bash
echo "Detecting your local IP address..."
echo ""
# Detect local IP based on OS
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS - try en0 (WiFi) then en1 (Ethernet)
IP=$(ipconfig getifaddr en0 2>/dev/null || ipconfig getifaddr en1 2>/dev/null || echo "")
INTERFACE=$(ifconfig en0 &>/dev/null && echo "en0 (WiFi)" || echo "en1 (Ethernet)")
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
IP=$(ip route get 1 | awk '{print $7;exit}' 2>/dev/null || hostname -I | awk '{print $1}')
INTERFACE="default"
else
# Windows or unknown
IP=$(hostname -I 2>/dev/null | awk '{print $1}' || echo "")
INTERFACE="unknown"
fi
if [ -z "$IP" ]; then
echo "❌ Could not detect IP address automatically"
echo ""
echo "Manual detection:"
echo " macOS: ipconfig getifaddr en0"
echo " Linux: ip route get 1 | awk '{print \$7}'"
echo " Windows: ipconfig (look for IPv4 Address)"
exit 1
fi
echo "✅ Your local IP: $IP ($INTERFACE)"
echo ""
echo "Use this in your plugin settings:"
echo " Base URL: http://$IP:8080"