28 lines
1.1 KiB
Bash
28 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
echo "=== Finding Gitea Local IP ==="
|
|
|
|
# Get local IP of gitea-lxc container
|
|
echo "1. Checking local IPs..."
|
|
ip addr show | grep -E "inet.*192\.|inet.*10\.|inet.*172\." || echo "No local IPs found"
|
|
|
|
echo "2. Trying to resolve gitea-lxc locally..."
|
|
ping -c 1 gitea-lxc 2>/dev/null | head -1 || echo "gitea-lxc not resolvable"
|
|
|
|
echo "3. Checking for Gitea process..."
|
|
ps aux | grep gitea || echo "No gitea process found"
|
|
|
|
echo "4. Checking what ports are listening..."
|
|
ss -tulpn | grep :3000 || echo "Port 3000 not listening"
|
|
ss -tulpn | grep :80 || echo "Port 80 not listening"
|
|
ss -tulpn | grep :443 || echo "Port 443 not listening"
|
|
|
|
echo "5. Testing local connection..."
|
|
LOCAL_IP=$(ip route get 8.8.8.8 | awk '{print $7; exit}')
|
|
echo "Local IP appears to be: $LOCAL_IP"
|
|
|
|
if [ ! -z "$LOCAL_IP" ]; then
|
|
echo "Testing HTTP connection to local IP..."
|
|
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" "http://$LOCAL_IP:3000/" || echo "Local HTTP not responding"
|
|
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" "http://$LOCAL_IP/" || echo "Local HTTP port 80 not responding"
|
|
fi |