Browse Source

deal w/ IndexError, and keep running as it closes often..

main
John-Mark Gurney 2 years ago
parent
commit
26f47d69c4
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      streaming

+ 7
- 2
streaming View File

@@ -1,6 +1,7 @@
#!/bin/sh

curl --no-buffer --digest -u installer:$(cat creds.inst.txt) http://$(read a b << EOF
while sleep .1; do
curl --no-buffer --digest -u installer:$(cat creds.inst.txt) http://$(read a b << EOF
$(cat creds.txt)
EOF
echo $a)/stream/meter 2>/dev/null | python3.8 -c 'import time; import sys
@@ -11,5 +12,9 @@ for i in inp:
i = i.strip()
if not i:
continue
i = i.split(maxsplit=1)[1]
try:
i = i.split(maxsplit=1)[1]
except IndexError:
continue
print(time.time(), i)' > home.power.$(date +%Y%m%d%H%M).log
done

Loading…
Cancel
Save