Added WunderCam (Weather Underground camera) proxy.

This commit is contained in:
Markus Birth 2016-08-16 17:56:09 +02:00
parent aae36f970e
commit f8f3502d6a
2 changed files with 24 additions and 0 deletions

View File

@ -16,3 +16,10 @@ RUNTASTIC_PUSHOVER_TOKEN="0123456...PushOver App Token...6789abcdef"
# Login for packtclaim.py
PACKT_LOGIN = anon@example.org
PACKT_PASSWORD = 1234567
# WunderCam Proxy
SNAPSHOT_URL="http://my-ip-camera.com/tmpfs/snap.jpg"
SNAPSHOT_USERNAME="guest"
SNAPSHOT_PASSWORD="password"
WUNDERCAM_USERNAME="mypersonalCAM1"
WUNDERCAM_PASSWORD="secretpassword"

17
wundercam_proxy.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
HERE=`dirname $0`
. $HERE/CONFIG
WUNDERCAM_URL="ftp://webcam.wunderground.com/image.jpg"
TMPFILE=`tempfile -p "snap" -s ".jpg"`
curl -v -u "$SNAPSHOT_USERNAME:$SNAPSHOT_PASSWORD" $SNAPSHOT_URL -o "$TMPFILE"
if [ $? -eq 0 ]; then
curl -v -T "$TMPFILE" --ftp-pasv -u "$WUNDERCAM_USERNAME:$WUNDERCAM_PASSWORD" $WUNDERCAM_URL
else
echo "ERROR: Problem while downloading $SNAPSHOT_URL." 1>&2
fi
find /tmp -maxdepth 1 -type f -name "snap*.jpg" -mmin +120 -delete