#!/bin/bash # LibreOffice installation script for DigiServer v2 # This script installs LibreOffice for PPTX to image conversion set -e echo "======================================" echo "LibreOffice Installation Script" echo "======================================" echo "" # Check if already installed if command -v libreoffice &> /dev/null; then VERSION=$(libreoffice --version 2>/dev/null || echo "Unknown") echo "✅ LibreOffice is already installed: $VERSION" exit 0 fi echo "📦 Installing LibreOffice..." echo "" # Update package list echo "Updating package list..." apt-get update -qq # Install LibreOffice echo "Installing LibreOffice (this may take a few minutes)..." apt-get install -y libreoffice libreoffice-impress # Verify installation if command -v libreoffice &> /dev/null; then VERSION=$(libreoffice --version 2>/dev/null || echo "Installed") echo "" echo "✅ LibreOffice successfully installed: $VERSION" echo "" echo "You can now upload and convert PowerPoint presentations (PPTX files)." exit 0 else echo "" echo "❌ LibreOffice installation failed" exit 1 fi