Tool

Stomfi's picture
tool
Reads:

3185

Score:
0
0
 
Comments:

0

Send IP

license: 
GPL

This handy tool is a way to send an IP or Domain name from a remote site when needing to set-up a VPN or SSH session to a network that doesn't have a www address. This often happens when the target is connected through an ISP with a dynamic IP address.

The target network is running a (SUSE) Linux box on their network, which can be primarily MS windows or something, has someway of sending an email from the command line, and optionally uses a cron table. (see HowTo: Using the cron shell tool to automate procedures - Part 2 of 3 on how to do this.)

As the Linux box that grabs, processes and sends this information does little else, I use the sleep option and run it continuously in the background. It starts from rc.local, so will send an IP address as soon as the network and its Internet connection comes online.

If you want to use it from crontab, leave out the while loop and sleep, and export OLDIP so sendip.sh can compare it next time it runs. If security is an issue, encrypt $NEWIP before sending it with mutt.

This shell script sends a line like 207.142.131.236 and only sends another if it has changed after the sleep period.

ZałącznikWielkość
sendip.zip488 bytes




User Comments

© 2013 Novell