check-apt-key.sh 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. #Verify with the key fatch from https://ftp-master.debian.org/keys.html
  3. #---------------------------------------------------------------------------
  4. #"Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>"
  5. JESSIEARCHIVEKEY=" 126C 0D24 BD8A 2942 CC7D F8AC 7638 D044 2B90 D010"
  6. CHECKTMP=$(apt-key finger | grep -B 1 "Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
  7. if [ "$CHECKTMP" == "$JESSIEARCHIVEKEY" ];then
  8. echo Good
  9. :
  10. else
  11. echo bad
  12. exit 1
  13. fi
  14. #---------------------------------------------------------------------------
  15. #"Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>"
  16. JESSIESECURITYKEY=" D211 6914 1CEC D440 F2EB 8DDA 9D6D 8F6B C857 C906"
  17. CHECKTMP=$(apt-key finger | grep -B 1 "Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
  18. if [ "$CHECKTMP" == "$JESSIESECURITYKEY" ];then
  19. echo Good
  20. :
  21. else
  22. echo bad
  23. exit 1
  24. fi
  25. #---------------------------------------------------------------------------
  26. #"Jessie Stable Release Key <debian-release@lists.debian.org>"
  27. JESSIESTABLEKEY=" 75DD C3C4 A499 F1A1 8CB5 F3C8 CBF8 D6FD 518E 17E1"
  28. CHECKTMP=$(apt-key finger | grep -B 1 "Jessie Stable Release Key <debian-release@lists.debian.org>" | head -n1 | awk -F '=' '{printf $2}')
  29. if [ "$CHECKTMP" == "$JESSIESTABLEKEY" ];then
  30. echo Good
  31. :
  32. else
  33. echo bad
  34. exit 1
  35. fi
  36. #---------------------------------------------------------------------------
  37. #"Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>"
  38. SQUEEZEARCHIVEKEY=" 9FED 2BCB DCD2 9CDF 7626 78CB AED4 B06F 4730 41FA"
  39. CHECKTMP=$(apt-key finger | grep -B 1 "Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
  40. if [ "$CHECKTMP" == "$SQUEEZEARCHIVEKEY" ];then
  41. echo Good
  42. :
  43. else
  44. echo bad
  45. exit 1
  46. fi
  47. #---------------------------------------------------------------------------
  48. #"Squeeze Stable Release Key <debian-release@lists.debian.org>"
  49. SQUEEZESTABLEKEY=" 0E4E DE2C 7F3E 1FC0 D033 800E 6448 1591 B983 21F9"
  50. CHECKTMP=$(apt-key finger | grep -B 1 "Squeeze Stable Release Key <debian-release@lists.debian.org>" | head -n1 | awk -F '=' '{printf $2}')
  51. if [ "$CHECKTMP" == "$SQUEEZESTABLEKEY" ];then
  52. echo Good
  53. :
  54. else
  55. echo bad
  56. exit 1
  57. fi
  58. #---------------------------------------------------------------------------
  59. #"Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>"
  60. WHEEZYARCHIVEKEY=" A1BD 8E9D 78F7 FE5C 3E65 D8AF 8B48 AD62 4692 5553"
  61. CHECKTMP=$(apt-key finger | grep -B 1 "Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
  62. if [ "$CHECKTMP" == "$WHEEZYARCHIVEKEY" ];then
  63. echo Good
  64. :
  65. else
  66. echo bad
  67. exit 1
  68. fi
  69. #---------------------------------------------------------------------------
  70. #"Wheezy Stable Release Key <debian-release@lists.debian.org>"
  71. WHEEZYSTABLEKEY=" ED6D 6527 1AAC F0FF 15D1 2303 6FB2 A1C2 65FF B764"
  72. CHECKTMP=$(apt-key finger | grep -B 1 "Wheezy Stable Release Key <debian-release@lists.debian.org>" | head -n1 | awk -F '=' '{printf $2}')
  73. if [ "$CHECKTMP" == "$WHEEZYSTABLEKEY" ];then
  74. echo Good
  75. :
  76. else
  77. echo bad
  78. exit 1
  79. fi