From 762c5d886162e4ab764287cea897541aeb6f0f9d Mon Sep 17 00:00:00 2001 From: Roman Nikolaev Date: Thu, 4 Jan 2024 23:09:30 +0300 Subject: [PATCH] Add user-agent (curl) (#495) * Add user-agent (curl) * user-agent: Linux x86_64 --- .../fullpageos/filesystem/home/pi/scripts/run_onepageos | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/run_onepageos b/src/modules/fullpageos/filesystem/home/pi/scripts/run_onepageos index b7cdef7..26141a6 100755 --- a/src/modules/fullpageos/filesystem/home/pi/scripts/run_onepageos +++ b/src/modules/fullpageos/filesystem/home/pi/scripts/run_onepageos @@ -1,8 +1,10 @@ #!/bin/bash +USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" + while true do - if [[ $(curl -sL -b cookiefile -w "%{http_code}\\n" "$(/home/pi/scripts/get_url)" -o /dev/null) =~ ^([23][0-9]{2,2}|401)$ ]] || grep -q disabled "/boot/check_for_httpd" ; then + if [[ $(curl -sL -b cookiefile -w "%{http_code}\\n" -H "user-agent: ${USER_AGENT}" "$(/home/pi/scripts/get_url)" -o /dev/null) =~ ^([23][0-9]{2,2}|401)$ ]] || grep -q disabled "/boot/check_for_httpd" ; then xdotool mousemove 9000 9000 %BROWSER_START_SCRIPT% fi