#!/usr/bin/env bash
echo "========================================================"
echo "  ARSchool Scanner Bridge Agent untuk Linux (SANE)"
echo "========================================================"
echo ""

if ! command -v python3 &> /dev/null; then
    echo "[PERINGATAN] Python 3 belum terpasang di sistem Linux ini."
    echo "Pasang dengan: sudo apt-get install python3"
    exit 1
fi

if ! command -v scanimage &> /dev/null; then
    echo "[INFO] Pustaka SANE direkomendasikan untuk scanner Linux:"
    echo "sudo apt-get install sane sane-utils"
    echo ""
fi

echo "Memulai ARSchool Scanner Bridge Agent di http://127.0.0.1:18080 ..."
echo "Terminal ini harus tetap terbuka selama memindai dokumen di ARSchool."
echo ""
python3 "$(dirname "$0")/arschool-scanner-agent.py"
