Skip to content

jozuenoon/iptracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

IPTracker

This small application use this http://ifconfig.me service to discover your current IP. Logs are organized in YYYY/MM/DD.log structure.

Example:

~/ipmon$ tree
.
└── 2017
    └── 12
        ├── 06.log
        └── 07.log

Log structure:

2017-12-07 00:20:30 |ERROR| Get http://ifconfig.me/all.json: read tcp 192.168.0.101:51010->153.121.72.212:80: read: connection reset by peer
2017-12-07 00:25:01 |INFO| 192.168.1.1

Usage

Using other services that return json with ip_addr field is possible. However field name is fixed.

$ iptracker -help
Usage of iptracker:
  -path string
        path to save logs (default "$HOME/ipmon")
  -url string
        URL to get IP address (default "http://ifconfig.me/all.json")

Installation

Default installation will build and move binary to $HOME/bin folder. Use with care.

One could install this application using:

make install

To build only use:

make build

Output is saved in ./bin directory.

Example cron configuration

Use command crontab -e. You NEED to specify full path to binary. With this configuration cron will run every 5 minutes.

*/5 * * * * /<your_full_path_to_home_dir>/bin/iptracker

About

Small app to log your current public IP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published