the stuff

heads-generate-debug 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2016-2018 Ivan J. <parazyd@dyne.org>
  4. # See LICENSE file for copyright and license details.
  5. #
  6. # this script will generate an encrypted tarball which you will then
  7. # be able to send to me for examination
  8. PATH="/usr/bin:/usr/sbin:/bin:/sbin"
  9. [ "$(whoami)" = root ] || {
  10. printf "you should run this as root!\n"
  11. printf "try using 'sup' to call this script."
  12. exit 1
  13. }
  14. debugdir="/root/heads-debug"
  15. cat /usr/share/heads/fa1b0274.asc | gpg --quiet --import
  16. mkdir -p "$debugdir"
  17. dmesg > "$debugdir"/dmesg
  18. lsmod > "$debugdir"/lsmod
  19. mount > "$debugdir"/mount
  20. ps auxf > "$debugdir"/psauxf
  21. lsusb -v > "$debugdir"/lsusb
  22. lspci -kv > "$debugdir"/lspci
  23. cp -r /var/log "$debugdir"/varlog
  24. cat /proc/cpuinfo > "$debugdir"/cpuinfo
  25. cat /proc/cmdline > "$debugdir"/cmdline
  26. cat /proc/meminfo > "$debugdir"/meminfo
  27. iptables-save > "$debugdir"/iptables.rules
  28. cd /root
  29. tar czf heads-debug.tgz heads-debug && rm -rf heads-debug
  30. gpg --encrypt --encrypt-to parazyd@dyne.org heads-debug.tgz || {
  31. printf "failed encrypting! this is a bug :(\n"
  32. exit 1
  33. }
  34. mv -v heads-debug.* /home/luther/
  35. chown luther:luther /home/luther/heads-debug.*
  36. cat <<EOM
  37. ------------------------------------
  38. Thank you for making a debug report!
  39. The tarball is created and encrypted with 0xfa1b0274 <parazyd@dyne.org>
  40. It can be found in: /home/luther/heads-debug.tgz.gpg
  41. Please send it via email to <parazyd@dyne.org>
  42. An unencrypted tarball is in the same place for you to check.
  43. EOM