Advertisement
Guest User

Untitled

a guest
May 8th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #!/bin/bash
  2. #unattended_ubuntu
  3. source ../src/common.sh
  4.  
  5. #Check for pgp
  6.  
  7. function get_user_input_pgp_key(){
  8. echo "Enter the name or ID of the pgp key that you would like to use"
  9. read pgp_key_to_test
  10. echo
  11. }
  12.  
  13. function check_if_the_key_exists(){
  14. if [[ $(gpg -k $pgp_key_to_test ) = "gpg: error reading key: No public key" ]]; then
  15. echo "No Key"
  16. else
  17. echo "Key Good"
  18. fi
  19. }
  20.  
  21. function run_it(){
  22. get_user_input_pgp_key
  23. check_if_the_key_exists
  24. }
  25.  
  26. run_it
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement