import_gpg_to_apt 487 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. ###
  3. #
  4. # Author: Stéphane HUC
  5. # mail: devs@stephane-huc.net
  6. #
  7. # License: GNU/GPL 3
  8. #
  9. # GitLab: https://git.framasoft.org/hucste/tools/
  10. #
  11. # Date: 2016/03/01
  12. #
  13. ###
  14. verify_uid() {
  15. if [[ $(id -u) -ne 0 ]]; then
  16. printf "[ \\33[1;31m %s \\33[0;39m ] %s \n" "KO" "Need to get rights admins!"
  17. exit 1
  18. fi
  19. }
  20. verify_uid
  21. ###
  22. # This tool is created for *Buntu!
  23. ###
  24. gpg --keyserver keyserver.ubuntu.com --recv-key $1
  25. gpg -a --export $1 | sudo apt-key add -