Guest User

Untitled

a guest
Dec 6th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash
  2. extract_file () {
  3. sed -n '/^ ip address /{s/^ ip address \([^ ]*\) .*/\1/;p;q;}'
  4. }
  5.  
  6. extract_dns () {
  7. dig +short "$1" | head -n 1
  8. }
  9.  
  10. if [ $(extract_file <e.txt) == $(extract_dns "hostname.org") ]; then
  11. ./vpn2.sh
  12. fi
  13.  
  14.  
  15.  
  16.  
  17. andrea@andypc:~$ sh -x ee.sh
  18. + extract_file
  19. + sed -n /^ ip address /{s/^ ip address \([^ ]*\) .*/\1/;p;q;}
  20. + extract_dns dfg1.no-ip.org
  21. + dig +short dfg1.no-ip.org
  22. + head -n 1
  23. + [ 79.1.134.136 == 79.1.134.136 ]
  24. [: 1: 79.1.134.136: unexpected operator
  25. andrea@andypc:~$
Add Comment
Please, Sign In to add comment