@chris said in Check if pimatic is running with shell:
Yes you could use a smal shellscript on the first pi to check if the other one is running.
#!/bin/bash
username=xxxxxx
hostname=xxx.xxx.xxx.xxx(IP)
password=xxxxxxxxx
sshpass -p $password ssh -o StrictHostKeyChecking=no $username@$hostname [command]
- use the command without the brackets[]
OK, i make a skript named pimatic-uptime.sh and copy yours inside with the username and password of my pimatic. At the hostname i write my ip and :8083 for the Port i use. delete the brakes. Was that ok so?
–> here a shellsensor with come cut of the result of your
so the shellsensor could have the following command:
/path/to/shellscript/ | cut -d -f10
here he only searches the 10th part of you output (start)
this you use in your rules then…
OK, here begins my problem… I create a ShellSensor for the first time… I take the command you wrote above in the command-line of the sensor (of course with my path of the pimatic-uptime.sh) but what must i do with the attributeName?
If I don´t fill it out i get a Error : Cannot read property ‘toUpperCase’ of undefined
And when I fill it for example with a word i get this Error:
error [pimatic-shell-execute]: [ShellSensor#status-homatic] Error: Command failed: /bin/sh -c /home/pi/pimatic-uptime.sh | cut -d -f10
/bin/sh: 1: /home/pi/pimatic-uptime.sh: Permission denied
cut: Trenner muss ein einzelnes Zeichen sein
„cut --help“ liefert weitere Informationen.
Sorry but i´m a noob with Shell…
(if shellsensordevice != start then do …)
OK, this would be no Problem if I come to this Point…