External IP Address Recording Script Andrew Mallett | Updated July 2013

Following on from the External IP Address Monitor, the following script will record changes to a user's external IP Address into a clear text file.

cd /sc/extip
rm /sc/extip/ip.php
wget http://shell-scripts.com/ip.php
echo `/bin/date +%Y-%m-%d` `/bin/cat /sc/extip/ip.php` >> /sc/extip/ip_record

The above script firstly changes to a (previously created) directory called extip. On the second line, the previous day's result, ip.php is firstly deleted. The script then Wgets a new ip.php..

Finally the echo command is used to echo the current date and then the contents of the current ip.php file (the current IP Address) and appends the result to a log record file called ip_record.

The task is automated at two minutes past midnight via a new crontab entry..

02 00 * * * /sc/scripts/extip.sh

Remember to use full paths to all files in scripts which will run via cron.



Comments (1)

Could be used by the feds to keep a track of your internet porn browsing..
#1 - LinuxBLinux - 02/06/2015 - 10:52
E-mail (Will not appear online)
;-) :-) :-D :-( :-o :-O B-) :oops: :-[] :-P
To prevent automated Bots form spamming, please enter the text you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
This comment form is powered by GentleSource Comment Script. It can be included in PHP or HTML files and allows visitors to leave comments on the website.

Throwaway Email   Disposable Email   Disposable Email