post.sh 674 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. read QUERY_STRING
  3. eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}')
  4. tmp=`httpd -d $Text_Field`
  5. echo -ne $tmp >/lib/cryptsetup/passfifo
  6. i=0
  7. while true; do
  8. sleep 1
  9. i=$(($i + 1))
  10. echo $i
  11. if [ -f /dev/mapper/root ] ; then
  12. echo "<html>"
  13. echo " <head>"
  14. echo " <title>Unlock root partition</title>"
  15. echo " </head>"
  16. echo ""
  17. echo " <body>"
  18. echo " <div style='text-align: center;'><IMG SRC='../unicorn.gif' ALT='image'>"
  19. echo " Disk unlock !!"
  20. echo " </div>"
  21. echo " </body>"
  22. echo "</html>"
  23. exit 0
  24. elif [ ${i} -gt 10 ] ; then
  25. cat ../index.html
  26. exit 0
  27. fi
  28. done
  29. exit 0