homelab importer funktioniert manuell

This commit is contained in:
2025-06-14 09:22:25 +02:00
parent 57df180581
commit 02509c5615
2 changed files with 18 additions and 0 deletions

18
homelab_importer.ssh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# Eingabedatei
INPUT_FILE="Homelab.mxtsessions"
# Ausgabedatei
OUTPUT_FILE="serverliste.csv"
# Kopfzeile der CSV schreiben
echo "Name,Adresse / Host" > "$OUTPUT_FILE"
# Daten extrahieren und formatieren
grep -oP '^[^=]+=#109#0%[^%]+' "$INPUT_FILE" | while IFS= read -r line; do
name=$(echo "$line" | cut -d'=' -f1 | sed 's/.*\\n//')
host=$(echo "$line" | cut -d'%' -f2)
echo "$name,$host" >> "$OUTPUT_FILE"
done
echo "Export abgeschlossen: $OUTPUT_FILE"

0
ssh_manager.sh Normal file → Executable file
View File