Closed Heljick closed 3 years ago
ok so from my understanding this Script type in your example yml is just to get the status of a ping or a service. How is it possible to use script to actually run a cmd ? Is this only possible ?
Hi!
While I haven't tried to run a command over ssh myself. I think it should be possible to do so. Try to use ssh keys instead of a password.
The command in the Status
field is for checking the status via the command's exit code. If it exits with 0 exit code it will show as on otherwise it will show as off. The Status
command will run every time the appliance status is checked. There is an Action:
feild that takes On:
and Off:
as subfields where you can specify commands that should be run to turn the appliance on or off.
See the example for reference https://github.com/ThisIsQasim/WebGPIO/blob/master/exampleconfig.yml
Thanks, I have no issue with SSH, I just can't found how to run my cmd with WebGPIO. I don't need an on/off action, only a run script action when a button is pressed.
So I succeeded to make a button working for a cmd:
Status, is useless but web interface crash if not set Timeout, just change time between status check if I am guessing right Action, no need of it as i am trying to run a cmd when button ON On, is the actual cmd I want to run Off, not needed as Action
So two things:
If you have any advice please let me know ;)
Issue solved ! I had to force the user in order to pass the cmd, don't know why but it work.
sudo runuser -l user -c 'mycmd'
Glad to know that it worked!
Hi me again, I am trying to run an sshpass command via WenGPIO and can't figure out how to make it work. I tried to put the cmd into a .sh file too, work when I run it in command line but not with WebGPIO.
Here is what I tried:
or
I tried with a Timer or Action on/off but no luck :/