Dateien nach "scripts" hochladen

This commit is contained in:
2026-04-20 20:20:35 +02:00
parent 5c2df046f0
commit 2308196097
+49 -10
View File
@@ -76,22 +76,58 @@ detect_resources() {
DEFAULT_BRIDGE=$(ip link show 2>/dev/null | grep -oP '(?<=: )vmbr\d+' | head -1 || echo "vmbr0")
}
# ── Debian 12 Template ─────────────────────────────────────────────────────────
# ── Template auswählen ────────────────────────────────────────────────────────
prepare_template() {
step "Debian 12 Template prüfen"
TEMPLATE_FILE=$(pveam list local 2>/dev/null | grep -oP 'debian-12-standard_\S+' | sort -V | tail -1 || true)
step "LXC Template auswählen"
if [[ -z "$TEMPLATE_FILE" ]]; then
info "Nicht lokal vorhanden lade herunter..."
# Lokal vorhandene Templates auflisten
local available_local
available_local=$(pveam list local 2>/dev/null | awk 'NR>1{print $1}' | grep -oP '[^/]+\.tar\.(gz|zst|xz)' | sort || true)
# Default: neuestes Debian 12
local default_tpl
default_tpl=$(echo "$available_local" | grep -oP 'debian-12-standard_\S+' | sort -V | tail -1 || true)
if [[ -z "$default_tpl" ]]; then
# Noch nicht heruntergeladen aus verfügbaren holen
pveam update &>/dev/null || warn "pveam update fehlgeschlagen"
TEMPLATE_FILE=$(pveam available --section system 2>/dev/null \
| grep -oP 'debian-12-standard_\S+' | sort -V | tail -1 || echo "debian-12-standard_12.7-1_amd64.tar.zst")
info "Lade: $TEMPLATE_FILE"
default_tpl=$(pveam available --section system 2>/dev/null | grep -oP 'debian-12-standard_\S+' | sort -V | tail -1 || echo "debian-12-standard_12.7-1_amd64.tar.zst")
fi
if [[ -n "$available_local" ]]; then
echo -e " ${CYAN}Lokal verfügbare Templates:${NC}"
local i=1
while IFS= read -r tpl; do
[[ -z "$tpl" ]] && continue
local marker=""
[[ "$tpl" == "$default_tpl" ]] && marker=" ${GREEN}← Standard${NC}"
printf " ${CYAN}%-3s${NC} %s%b
" "$i" "$tpl" "$marker"
((i++))
done <<< "$available_local"
echo
echo -ne "${YELLOW}${NC}Template (Enter = Standard ${CYAN}${default_tpl}${NC}): "
read -r sel_tpl
if [[ -z "$sel_tpl" ]]; then
TEMPLATE_FILE="$default_tpl"
elif [[ "$sel_tpl" =~ ^[0-9]+$ ]]; then
TEMPLATE_FILE=$(echo "$available_local" | sed -n "${sel_tpl}p")
[[ -z "$TEMPLATE_FILE" ]] && { warn "Ungültige Auswahl, nehme Standard."; TEMPLATE_FILE="$default_tpl"; }
else
TEMPLATE_FILE="$sel_tpl"
fi
else
TEMPLATE_FILE="$default_tpl"
fi
# Herunterladen falls nicht lokal vorhanden
if ! pveam list local 2>/dev/null | grep -q "$TEMPLATE_FILE"; then
info "Lade Template herunter: $TEMPLATE_FILE"
pveam download local "$TEMPLATE_FILE" || error "Template-Download fehlgeschlagen!"
fi
TEMPLATE_PATH="local:vztmpl/${TEMPLATE_FILE}"
success "Template bereit: $TEMPLATE_FILE"
success "Template: $TEMPLATE_FILE"
}
# ── Konfiguration abfragen ─────────────────────────────────────────────────────
@@ -291,6 +327,9 @@ ok "Portainer gestartet"
# ── Filebrowser ──────────────────────────────────────────────────────────────────
inf "Filebrowser installieren (Port \${FB_PORT})..."
# Verzeichnisse mit korrekten Rechten anlegen (1000:1000 = gleicher User wie Filebrowser+Freqtrade)
mkdir -p "\$INSTALL_DIR/filebrowser/config" "\$INSTALL_DIR/filebrowser/database"
chown -R 1000:1000 "\$INSTALL_DIR/filebrowser"
cat > "\$INSTALL_DIR/filebrowser/docker-compose.yml" << 'FBEOF'
services:
filebrowser:
@@ -300,7 +339,7 @@ services:
ports:
- "FBPORT:8080"
volumes:
- /opt/docker-projekte:/srv
- /opt/docker-projekte/freqtrade:/srv
- /opt/docker-projekte/filebrowser/database:/database
- /opt/docker-projekte/filebrowser/config:/config
command: ["--address","0.0.0.0","--port","8080",