diff --git a/cgi-bin/kraut.space b/cgi-bin/kraut.space index b07633a..b0542a0 100755 --- a/cgi-bin/kraut.space +++ b/cgi-bin/kraut.space @@ -20,11 +20,18 @@ cmd=$(getp cmd) # check secret # the secrets file has to contain the hashes on a single line, comments are allowed on seperate lines # secrets can only contain the characters that are allowed in getp() with tr -cd -if [ -z "$secret" ] || [ "$secret_length" -lt 30 ] || ! grep -q ";$hashed_secret$" /etc/tuer3.0/door_access_list; then +if [ -z "$secret" ] \ + || [ "$secret_length" -lt 30 ] \ + || ! grep -q ";$hashed_secret$" /etc/tuer3.0/door_access_list +then header - [ -z "$secret" ] || echo "

Ich bin mir nicht sicher. Mir scheint, du bist doch ein Kohlkopf oder Anderes!

" - # $hashed_secret" - cat /var/www/tpl/secret.html + + CABBAGE="" + [ -z "$secret" ] || CABBAGE="Ich bin mir nicht sicher. Mir scheint, du bist doch ein Kohlkopf oder Anderes!" + + # shellcheck disable=SC2002 + cat /var/www/tpl/secret.html | sed 's//'"$CABBAGE"'/' + exit fi @@ -40,9 +47,9 @@ if [ -n "$cmd" ]; then # execute long-running ppio job in background shell ( sleep $delay1 - /usr/local/bin/gpio -g write $pin on - sleep $delay2 - /usr/local/bin/gpio -g write $pin off + /usr/local/bin/gpio -g write $pin on + sleep $delay2 + /usr/local/bin/gpio -g write $pin off ) /dev/null 2>/dev/null & DATE="$(date +"%F %T")" @@ -50,8 +57,8 @@ if [ -n "$cmd" ]; then header sed 's/XTIMEOUTX/'"$((delay1 + delay2))"'/' /var/www/tpl/wait.html | sed 's/XSECRETX/'"$secret"/ - exit + exit fi # show feature page diff --git a/tpl/secret.html b/tpl/secret.html index d802e61..fe859b6 100644 --- a/tpl/secret.html +++ b/tpl/secret.html @@ -11,6 +11,7 @@

Sprich Sterblicher!

+

Bist du ein menschliches Wesen und kein Kohlkopf oder Anderes?