commit 79f9dd69615d9fb585a7ae3f547e3611f465aa4b Author: jan Date: Thu Sep 6 23:07:37 2018 +0200 First commit, base version A OK diff --git a/ReadMe.md b/ReadMe.md new file mode 100644 index 0000000..de195a0 --- /dev/null +++ b/ReadMe.md @@ -0,0 +1,3 @@ +# addresslog + +Very basic ```sh``` script to log your IP into a csv file. \ No newline at end of file diff --git a/addresslog_data.csv b/addresslog_data.csv new file mode 100644 index 0000000..ef6c621 --- /dev/null +++ b/addresslog_data.csv @@ -0,0 +1 @@ +datetime(iso8601),hostname,IPv4,IPv6 diff --git a/addresslog_script.sh b/addresslog_script.sh new file mode 100755 index 0000000..650d627 --- /dev/null +++ b/addresslog_script.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Define vars + +AL_CSV="addresslog_data.csv" +AL_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") +AL_IPv4=$(curl -4s ifconfig.co) +AL_IPv6=$(curl -6s ifconfig.co) + +printf "$AL_DATE,$(hostname),$AL_IPv4,$AL_IPv6\n" >> $AL_CSV \ No newline at end of file