#!/bin/bash
URL="https://elita-ikbal.uingusdur.ac.id/login"
UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 CBTKioskClient/1.0"
PROFILE="${TMPDIR:-/tmp}/elita-ikbal-kiosk"

if command -v google-chrome-stable &> /dev/null; then
    google-chrome-stable --kiosk --user-agent="$UA" --user-data-dir="$PROFILE" --no-first-run --no-default-browser-check "$URL"
elif command -v google-chrome &> /dev/null; then
    google-chrome --kiosk --user-agent="$UA" --user-data-dir="$PROFILE" --no-first-run --no-default-browser-check "$URL"
elif command -v microsoft-edge-stable &> /dev/null; then
    microsoft-edge-stable --kiosk --user-agent="$UA" --user-data-dir="$PROFILE" --no-first-run --no-default-browser-check "$URL"
elif command -v microsoft-edge &> /dev/null; then
    microsoft-edge --kiosk --user-agent="$UA" --user-data-dir="$PROFILE" --no-first-run --no-default-browser-check "$URL"
else
    echo "Google Chrome atau Microsoft Edge tidak ditemukan."
    echo "Install salah satu: https://www.google.com/chrome/ atau https://www.microsoft.com/edge"
fi
