Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 6th, 2018 57 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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:~$
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top