You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.0 KiB

  1. #!/bin/sh
  2. #Get EETI Debug information script. Version 1.0 (20201007)
  3. INFO_PATH="./eeti/info.html"
  4. DMESG_PATH="./eeti/dmesg"
  5. INFO_FOLDER="./eeti/"
  6. CheckPermission() {
  7. echo -n "(I) Check user permission:"
  8. account=`whoami`
  9. if [ ${account} = "root" ]; then
  10. echo " ${account}, you are the supervisor."
  11. else
  12. echo " ${account}, you are NOT the supervisor."
  13. echo "(E) The root permission is required to run this installer."
  14. echo ""
  15. exit 1
  16. fi
  17. }
  18. CheckPermission
  19. echo "Start to collect log..."
  20. #Modify DebugBits
  21. CONFIG_FILE="/etc/eGTouchL.ini"
  22. DEBUG_BITS="FFFFF"
  23. sed -i '2d' $CONFIG_FILE
  24. sed -i '1a DebugEnableBits\t\t\t'`echo $DEBUG_BITS` $CONFIG_FILE
  25. #Restart driver
  26. eGTouchD -f
  27. sleep 5
  28. #Create folder to put information
  29. mkdir $INFO_FOLDER
  30. touch $INFO_PATH
  31. chmod 666 $INFO_PATH
  32. #Print Information to file
  33. {
  34. echo "<html>"
  35. echo "<body>"
  36. echo "<tr>"
  37. echo "<h1><strong><th>EETI Debug Log</th></strong></h1>"
  38. echo "</tr>"
  39. echo "<tr>"
  40. date
  41. echo "<p><strong><th>=====CPU Arch.=====</th></strong></p>"
  42. lscpu | grep Architecture
  43. echo "</tr>"
  44. echo "<tr>"
  45. echo "<p><strong><th>=====Kernel version.=====</th></strong></p>"
  46. uname -r
  47. echo "</tr>"
  48. echo "<tr>"
  49. echo "<p><strong><th>=====Distribution Info.=====</th></strong></p>"
  50. cat /etc/*release
  51. echo "</tr>"
  52. echo "<tr>"
  53. echo "<p><strong><th>=====Display server=====</th></strong></p>"
  54. ps -e | grep tty
  55. echo "</tr>"
  56. echo "<tr>"
  57. echo "<p><strong><th>=====Xinput Info.=====</th></strong></p>"
  58. xinput list
  59. echo "</tr>"
  60. echo "<tr>"
  61. echo "<p><strong><th>=====Input Devices=====</th></strong></p>"
  62. cat /proc/bus/input/devices
  63. echo "</tr>"
  64. echo "</body>"
  65. echo "</html>"
  66. }> $INFO_PATH
  67. #Copy dmesg
  68. dmesg >> "$DMESG_PATH"
  69. #Copy driver log
  70. cp /tmp/eGTouch* $INFO_FOLDER
  71. #Recover DebugBits
  72. DEBUG_BITS="1"
  73. sed -i '2d' $CONFIG_FILE
  74. sed -i '1a DebugEnableBits\t\t\t'`echo $DEBUG_BITS` $CONFIG_FILE
  75. #Copy config file
  76. cp $CONFIG_FILE $INFO_FOLDER
  77. #Restart driver
  78. eGTouchD -f
  79. tar --remove-files -zcvf ./eeti.tar.gz $INFO_FOLDER > /dev/null
  80. echo "Finish."