Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. root@OpenWrt:/usr/share/3ginfo/cgi-bin# cat ussd1.sh
  2. #!/bin/sh
  3.  
  4. echo "Content-type: text/html"
  5. echo ""
  6. echo "
  7. <html>
  8. <style type=\"text/css\">
  9. body {
  10. font-family: Verdana, Arial, Helvetica, sans-serif;
  11. }
  12. #centered {
  13. width: 800px;
  14. margin: auto;
  15. text-align: center;
  16. }
  17. .label {
  18. text-align: left;
  19. }
  20. .text {
  21. width: 100%;
  22. }
  23. pre {
  24. text-align: left;
  25. }
  26. </style>
  27. <head>
  28. <title>USSD</title>
  29. <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
  30. </head>
  31. <body>
  32. "
  33. if [ "$REQUEST_METHOD" = POST ]; then
  34. read -t 3 QUERY_STRING
  35. eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}')
  36. action=`uhttpd -d $action`
  37. ussd=`uhttpd -d $ussd`
  38. else
  39. action="x"
  40. fi
  41.  
  42. case "$action" in
  43. send)
  44. A=$(ussd159 -p $(uci get 3ginfo.@3ginfo[0].device1) -t 30 -u "$ussd")
  45. echo "Odpowiedź: $A<br /><br />"
  46. ;;
  47. esac
  48.  
  49. echo "
  50. <form method=\"post\">
  51. <input type=\"hidden\" name=\"action\" id=\"action\" value=\"send\">
  52. <div class=label>USSD:</div><input name=\"ussd\" class=text><br />
  53. <input type=\"submit\" name=\"submit\" value=\"Wyślij\" text-align=center>
  54. </form>
  55. </div>
  56. </body></html>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement