Files
2026-04-28 11:21:39 +02:00

36 lines
895 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# NetMon starten (ohne Docker, direkt auf dem System)
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# .env prüfen
if [ ! -f .env ]; then
echo "[!] .env nicht gefunden kopiere .env.example nach .env"
cp .env.example .env
echo "[!] Bitte .env anpassen und danach erneut starten:"
echo " nano .env"
exit 1
fi
# venv prüfen
if [ ! -d .venv ]; then
echo "[*] Erstelle virtualenv..."
python3 -m venv .venv
echo "[*] Installiere Abhängigkeiten..."
.venv/bin/pip install -q -r requirements.txt
fi
# data/ Verzeichnis
mkdir -p data
# Root-Prüfung (nmap/scapy braucht root für raw sockets)
if [ "$EUID" -ne 0 ]; then
echo "[!] WARNUNG: Kein root ARP-Scan und Port-Scan könnten fehlschlagen."
echo " Empfohlen: sudo $0"
fi
echo "[*] NetMon startet..."
exec .venv/bin/python3 src/main.py