Last active
November 3, 2018 21:49
-
-
Save ZigFisher/d58a165068248bc9c6689a6a98c6ab4a 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
#!/bin/sh | |
server="ipcam.octonix.net" | |
login="mylogin" | |
password="mypass" | |
devid="$(ifconfig eth0 | awk '/HWaddr/ {print $5}' | tr -d ':')" | |
snapshot="http://127.0.0.1/webcapture.jpg?command=snap&channel=1" | |
upload="http://${server}/~${login}/${devid}/$(TZ=':GMT-3' date +%Y/%m/%d/%H.%M'.jpg')" | |
timeout="12" | |
tmp="/var/tmp" | |
/bin/rdate -s time.nist.gov >/dev/null 2>&1 | |
echo ${upload} >/dev/null 2>&1 | |
curl -k -s --connect-timeout ${timeout} --max-time ${timeout} -o ${tmp}/snap.jpg "${snapshot}" >/dev/null 2>&1 | |
curl -k -s --connect-timeout ${timeout} --max-time ${timeout} -u "${login}:${password}" -T ${tmp}/snap.jpg "${upload}" >/dev/null 2>&1 | |
rm -f ${tmp}/snap.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment