Files
TailScan/start.sh
T

52 lines
1.3 KiB
Bash

#!/bin/bash
set -e
echo "=== TailScan Setup ==="
# Install nmap if missing
if ! command -v nmap &>/dev/null; then
echo "Installing nmap..."
if command -v apt-get &>/dev/null; then
sudo apt-get install -y nmap
elif command -v dnf &>/dev/null; then
sudo dnf install -y nmap
elif command -v yum &>/dev/null; then
sudo yum install -y nmap
else
echo "WARNING: Could not install nmap automatically. Install it manually."
fi
fi
# Install Python deps
if ! command -v pip3 &>/dev/null; then
echo "ERROR: pip3 not found. Install Python 3.11+ first."
exit 1
fi
echo "Installing Python dependencies..."
pip3 install -r requirements.txt -q
# Check .env exists
if [ ! -f .env ]; then
if [ -f .env.example ]; then
cp .env.example .env
echo ""
echo "✅ Created .env from .env.example"
echo "👉 Edit .env and fill in your Tailscale OAuth credentials, then re-run ./start.sh"
exit 0
fi
fi
# Validate .env
if grep -q "your_client_id_here" .env 2>/dev/null; then
echo "ERROR: .env not configured. Edit .env and fill in TAILSCALE_CLIENT_ID etc."
exit 1
fi
echo "Starting TailScan on port 8080..."
echo "Access at: http://$(tailscale ip -4 2>/dev/null || echo '<tailscale-ip>'):8080"
echo ""
# Run (needs sudo for nmap raw sockets)
sudo python3 main.py