From 8c338df532e93408488c703ce614dca22395bcf6 Mon Sep 17 00:00:00 2001 From: Pascal Bouquet Date: Wed, 17 Sep 2025 10:59:18 +0200 Subject: [PATCH] fix: rename who to w -hs and adjust Firefox URL --- 99-captive-portal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/99-captive-portal b/99-captive-portal index 6d70786..2f10ada 100755 --- a/99-captive-portal +++ b/99-captive-portal @@ -36,14 +36,14 @@ if [[ "$1" == wl* ]] && [ "$2" = "up" ]; then log "CAPTIVE PORTAL DETECTED! Opening browser..." # Finde Benutzer und starte Firefox - local_user=$(who | grep "(:0)" | awk '{print $1}' | head -n1) + local_user=$(w -hs | grep ":0" | awk '{print $1}' | head -n1) if [ -n "$local_user" ]; then export DISPLAY=:0 export XAUTHORITY=/home/$local_user/.Xauthority # Starte Firefox im Hintergrund sudo -u $local_user env DISPLAY=:0 XAUTHORITY=/home/$local_user/.Xauthority \ - firefox --new-window "http://captive.apple.com" & + firefox --new-window "http://detectportal.firefox.com/canonical.html" & log "Firefox started for user $local_user" fi else