From a292621b9cf03d4174ed735fd696eb007d18c292 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 13 May 2024 19:36:42 +0200 Subject: [PATCH] webbuild-cgi: add log message for invalid secret; added a check for /var/autoport existence --- webbuild/webbuild-cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index 6973386..ba0b48d 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -56,6 +56,9 @@ if [ "$USER" ]; then USER_ENABLED= fi elif [ "${REQUEST:0:7}" != "refresh" ]; then + if [ "$SECRET" ]; then + echo "webbuild: invalid credentials: REQUEST=${REQUEST} USER=${USER} SECRET=${SECRET}" >&2 + fi # no "$USER_SECRET" set; require password echo -n "" u="$(uptime)" f="$(df / -k -h --output=avail,pcent|tail -n1)" - fap="$(df /var/autoport/* -k -h --output=avail,pcent|tail -n+2)" + [ -z "/var/autoport" ] && fap="$(df /var/autoport/* -k -h --output=avail,pcent|tail -n+2)" [ "$fap" ] && f="$f | ${fap/$'\n'/ | }" b=`ps ax|grep "rpmbuild .*\.spec$"|while read l; do basename "${l/.spec}"; done` echo -n "Load: ${u/*: } | Disk: $f | "