Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (41 loc) · 1.95 KB
/
Copy pathMakefile
File metadata and controls
51 lines (41 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# ═══════════════════════════════════════════════════════════════
# WirePi – Makefile
# ═══════════════════════════════════════════════════════════════
.PHONY: help install add-client health backup status logs deploy
help: ## Diese Hilfe anzeigen
@echo "WirePi – WireGuard VPN Server für Raspberry Pi 4"
@echo ""
@echo "Verfügbare Befehle:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
install: ## Vollständige Installation auf dem Pi ausführen
@echo "🚀 Starte WirePi Installation..."
sudo bash scripts/install.sh
add-client: ## Neuen WireGuard-Client hinzufügen (NAME=<name>)
@if [ -z "$(NAME)" ]; then \
echo "❌ Bitte NAME angeben: make add-client NAME=mein-laptop"; \
exit 1; \
fi
sudo bash scripts/wg-add-client.sh "$(NAME)"
health: ## Gesundheitscheck ausführen
bash scripts/health-check.sh
health-json: ## Gesundheitscheck als JSON
bash scripts/health-check.sh --json
backup: ## WireGuard-Konfiguration sichern
@echo "💾 Sichere WireGuard-Konfiguration..."
@mkdir -p backups/$(shell date +%Y%m%d_%H%M%S)
sudo cp -r /etc/wireguard backups/$(shell date +%Y%m%d_%H%M%S)/
sudo cp /etc/ddns.conf backups/$(shell date +%Y%m%d_%H%M%S)/ 2>/dev/null || true
@echo "✅ Backup erstellt."
status: ## WireGuard-Status anzeigen
sudo wg show
logs: ## WireGuard-Logs anzeigen
sudo journalctl -u wg-quick@wg0 -f
deploy: ## Dateien auf den Pi kopieren (PI_HOST=wirepi.local)
@if [ -z "$(PI_HOST)" ]; then \
PI_HOST=wirepi.local; \
fi
@echo "📤 Kopiere Dateien nach $$PI_HOST ..."
rsync -avz --exclude '.git' --exclude 'backups' \
./ "pi@$$PI_HOST:~/wirepi/"
@echo "✅ Deployment abgeschlossen."