Advertisement
Santeador

External_IP_To_FTP.sh

Apr 24th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #Basado en el script de @dvastazion http://pastebin.com/nJFXHuGk
  3. #Sube la IP pública del host a un ftp para su administración remota (Al estilo No-IP)
  4.  
  5. #Descubrimos el nombre del host
  6. hostname=$(hostname)
  7.  
  8. #Descubrimos la IP
  9. IP=$(curl icanhazip.com)
  10. which curl
  11.  
  12. if [ $? != 0 ];then
  13.     echo "This script need curl"
  14.     exit 1
  15. fi
  16.  
  17. #Creamos el txt con el nombre del host y la IP pública
  18. echo $IP > $hostname.txt
  19.  
  20. #Subimos el fichero
  21. curl -T $hostname.txt -u USER:PASSWORD ftp://ftp.domain.com/folder/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement