Added WunderCam (Weather Underground camera) proxy.
This commit is contained in:
parent
aae36f970e
commit
f8f3502d6a
@ -16,3 +16,10 @@ RUNTASTIC_PUSHOVER_TOKEN="0123456...PushOver App Token...6789abcdef"
|
|||||||
# Login for packtclaim.py
|
# Login for packtclaim.py
|
||||||
PACKT_LOGIN = anon@example.org
|
PACKT_LOGIN = anon@example.org
|
||||||
PACKT_PASSWORD = 1234567
|
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
17
wundercam_proxy.sh
Executable 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
|
Loading…
x
Reference in New Issue
Block a user