Selaa lähdekoodia

[bin] Update webcam captures and nyt

Colin Powell 2 kuukautta sitten
vanhempi
commit
1cbef14997
3 muutettua tiedostoa jossa 30 lisäystä ja 13 poistoa
  1. 3 2
      bin/.bin/nyt
  2. 23 11
      bin/.bin/webcam-capture
  3. 4 0
      bin/.bin/webcam-capture-all

+ 3 - 2
bin/.bin/nyt

@@ -10,8 +10,9 @@ else
 	DATEPATH=$(date +"%Y/%m/%d")
 	curl -o /tmp/nyt.pdf -L https://static01.nyt.com/images/$DATEPATH/nytfrontpage/scan.pdf
 	convert -density 150 -quality 75 $TMPFILE $OUTFILE
-	ln -sf $OUTFILE /var/lib/weewx/www/today.jpg
-	ln -sf $OUTFILE $BASEDIR/today.jpg
+	cd $BASEDIR
+	rm today.jpg
+	ln -sf $OUTFILE today.jpg
 	curl -H "X-Title: NYT headlines today" -d "https://files.lab.unbl.ink/nytimes/today.jpg" https://ntfy.unbl.ink/news
 	rm $TMPFILE
 fi

+ 23 - 11
bin/.bin/webcam-capture

@@ -1,15 +1,15 @@
 #!/bin/sh
-if [ "$1" = "frontyard" ]; then
+if [ "$1" = "mailbox" ]; then
   host="loge.local"
-  port=8082
+  port=8083
 fi
 if [ "$1" = "basement_table" ]; then
   host="loge.local"
   port=8081
 fi
-if [ "$1" = "mailbox" ]; then
+if [ "$1" = "frontyard" ]; then
   host="loge.local"
-  port=8083
+  port=8082
 fi
 if [ "$1" = "house" ]; then
   port=8083
@@ -28,17 +28,21 @@ if [ "$1" = "bulkhead" ]; then
   host="kiviuq.local"
 fi
 if [ "$1" = "backyard" ]; then
-  port=8083
+  port=8084
   host="paaliaq.local"
 fi
 if [ "$1" = "backyard_low" ]; then
   port=8081
   host="paaliaq.local"
 fi
-if [ "$1" = "basement_extension" ]; then
+if [ "$1" = "backyard_north" ]; then
   port=8082
   host="paaliaq.local"
 fi
+if [ "$1" = "basement_extension" ]; then
+  port=8083
+  host="paaliaq.local"
+fi
 if [ "$1" = "diningroom" ]; then
   port=8082
   host="kari.local"
@@ -51,18 +55,26 @@ if [ "$1" = "christmas_tree" ]; then
   port=8083
   host="mimas.local"
 fi
-if [ "$1" = "backyard_high" ]; then
-  port=8082
-  host="geforce.local"
-fi
 if [ "$1" = "orchard" ]; then
   port=8081
   host="mobian.local"
 fi
+if [ "$1" = "chicks" ]; then
+  port=8083
+  host="iapetus.local"
+fi
+if [ "$1" = "garage" ]; then
+  port=8082
+  host="iapetus.local"
+fi
+if [ "$1" = "barn" ]; then
+  port=8081
+  host="pan.local"
+fi
 
 ROOT="/var/photos/misc/webcams"
 filepath="$1/$(date +%Y)/$(date +%m)/$(date +%d)/$(date +%Y%m%d%H%M%S).jpg"
 mkdir -p /$ROOT/$1/$(date +%Y)/$(date +%m)/$(date +%d)/
 curl $host:$port/snapshot -o /$ROOT/$filepath
 url="https://files.lab.unbl.ink/webcams/$filepath"
-curl -H prio:low -H "click:$url" -d "Captured photo from $1 successfully" https://ntfy.unbl.ink/webcams
+#curl -H prio:low -H "click:$url" -d "Captured photo from $1 successfully" https://ntfy.unbl.ink/webcams

+ 4 - 0
bin/.bin/webcam-capture-all

@@ -5,8 +5,12 @@
 /home/powellc/.bin/webcam-capture mailbox
 /home/powellc/.bin/webcam-capture basement_extension
 /home/powellc/.bin/webcam-capture backyard_low
+/home/powellc/.bin/webcam-capture backyard_north
 /home/powellc/.bin/webcam-capture basement_cape
 /home/powellc/.bin/webcam-capture house
 /home/powellc/.bin/webcam-capture backyard
 /home/powellc/.bin/webcam-capture bulkhead
 /home/powellc/.bin/webcam-capture orchard
+/home/powellc/.bin/webcam-capture chicks
+/home/powellc/.bin/webcam-capture barn 
+/home/powellc/.bin/webcam-capture garage