forked from spraints/fowsr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfowsr.sh
40 lines (30 loc) · 792 Bytes
/
fowsr.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# Call fowsr with multiple parameters
PWSLOG=/var/log/fowsr/pwsweather.log
rm -f $PWSLOG
WUGLOG=/var/log/fowsr/wunderground.log
rm -f $WUGLOG
wsr="/usr/bin/fowsr -fw -fs"
$wsr
# Upload data to Wunderground
ID=$1
PASSWORD=$2
WGET=http://weatherstation.wunderground.com/weatherstation/updateweatherstation.php
WGET="$WGET?action=updateraw&ID=$ID&PASSWORD=$PASSWORD&softwaretype=fowsr&"
while read line
do
WGET2="$WGET`echo $line`"
echo $WGET2
wget -O /dev/null "$WGET2"
done < $WUGLOG
# Upload data to PWS Weather
ID=$1
PASSWORD=$2
WGET=http://www.pwsweather.com/pwsupdate/pwsupdate.php
WGET="$WGET?action=updateraw&ID=$ID&PASSWORD=$PASSWORD&softwaretype=fowsr&"
while read line
do
WGET2="$WGET`echo $line`"
echo $WGET2
wget -O /dev/null "$WGET2"
done < $PWSLOG