This error is new for me since 0.37, it stems from this part of my config:
- platform: command_line
command: if [[ $(ps ax | grep -v grep | grep syncthing | wc -l) -eq 0 ]]; then echo "0"; else echo "1"; fi
name: Syncthing
payload_on: 1
payload_off: 0
The command worked in 0.36 and works at a command prompt.
Something simple I’m missing?
fabaff
(Fabian Affolter)
2
On first glance I would say use quotes around the command.
1 Like
sebk-666
(Sebastian)
3
BTW: instead of
grep -v grep | grep syncthing
you can use
grep [s]yncthing
to save one of the grep calls.
Sebastian
1 Like
Thanks!
Now, looks like:
- platform: command_line
command: 'if [[ $(ps ax | grep [s]yncthing | wc -l) -eq 0 ]]; then echo "0"; else echo "1"; fi'
name: Syncthing
payload_on: 1
payload_off: 0
Thought it was working but I think it stems from a problem somewhere else, I’ll have to take a closer look.
Thanks!
I’ve changed it to your way now, much tidier.
I reckon I’ve a snag somewhere else.