Created
May 22, 2015 11:05
-
-
Save pczajkowski/9b498195b529798c17b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get time | |
MYTIME=$(date) | |
#get IPs | |
IP=$(/sbin/ip -o -4 addr list | awk '{print $2 ": ", $4}') | |
#remove linebreak | |
IPF=$(echo $IP) | |
#json content | |
post='{"public":false,"files":{"IP.txt":{"content":"'$MYTIME' : '${IPF}'"}}}' | |
#create a command | |
crl="curl --header 'Authorization: bearer YOUR_TOKEN_HERE' --header 'Accept: application/json' --header 'Content-type: application/json' --request POST --data '${post}' https://api.github.com/gists" | |
echo $crl | bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment