Guest User

tsekkaa.sh

a guest
Aug 28th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. NewIP=$(host example.dy.fi | cut -d ' ' -f4)
  4. echo "Uusi IP:   $NewIP"
  5.  
  6. CurIP=$(cat current.txt)
  7. echo "Vanha IP:  $CurIP"
  8.  
  9. if  [ $NewIP = $CurIP ] ; then
  10.     echo "Ei oo vaihtunna IP, myö en tee mittää."
  11. else
  12.     echo "Myö päivittelen, on vaihtunna IP..."
  13.     echo $NewIP > current.txt
  14.     echo $NewIP >> allips.txt
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment