Update mermaids.sh

This commit is contained in:
Dan 2026-04-16 09:34:06 +08:00
parent 35ab0d9667
commit e2525f23fb

View File

@ -129,15 +129,20 @@ log() { echo -e "${GREEN}[$(date +%H:%M:%S)]${NC} $1"; }
PORT="${1:-80}"
# 1. Update & install Caddy + deps
log "Updating system..."
apt-get clean -y
rm -rf /var/lib/apt/lists/*
apt-get update -o Acquire::Retries=3 || {
warn "First apt-get update failed. Checking network..."
cat /etc/resolv.conf
exit 1
}
apt-get install -y -qq wget ufw
log "Updating package lists..."
# Enable non-free for ufw (Debian 12 requirement)
if grep -q "deb debianmain" /etc/apt/sources.list; then
sed -i 's/deb \(.*\) main/deb \1 main non-free non-free-firmware/' /etc/apt/sources.list
fi
apt-get update -o Acquire::Retries=3
log "Installing dependencies..."
apt-get install -y -qq \
wget \
ufw \
curl \
apt-transport-https \
ca-certificates
# 2. Download Mermaid (offline bundled)
log "Downloading Mermaid v10.6.1 (offline)..."