Files
Projektarbeit-MYP/backend/scripts/get_kiosk_url.sh

32 lines
884 B
Bash

#!/bin/bash
# MYP Kiosk URL Ermittlung - HTTPS-Only
# Ermittelt die beste HTTPS-URL für den Kiosk-Modus
# Prioritäten für URL-Ermittlung:
# 1. Intranet-Domain (falls erreichbar)
# 2. Lokaler Hostname (falls erreichbar)
# 3. Localhost (Fallback)
# Teste Intranet-Domain
INTRANET_URL="https://m040tbaraspi001.de040.corpintra.net"
if curl -k -s --connect-timeout 2 --max-time 3 "$INTRANET_URL" >/dev/null 2>&1; then
echo "$INTRANET_URL"
exit 0
fi
# Teste lokalen Hostname
HOSTNAME=$(hostname)
LOCAL_URL="https://$HOSTNAME"
if curl -k -s --connect-timeout 2 --max-time 3 "$LOCAL_URL" >/dev/null 2>&1; then
echo "$LOCAL_URL"
exit 0
fi
# Teste localhost mit Port 443
if curl -k -s --connect-timeout 2 --max-time 3 "https://localhost:443" >/dev/null 2>&1; then
echo "https://localhost:443"
exit 0
fi
# Fallback: localhost ohne Port
echo "https://localhost"