
I'm facing a problem to use a script in an event:
My script works when the line is issued in terminal ssh but now when run from a switch or event:
Domoticz is in latest stable. Script has been chmoded.
My script is used to:
SSH from domoticz PI into my PI network player then shut it down:
This
Code: Select all
#!/bin/bash
sshpass -p "password" ssh [email protected] sudo bash /var/local/www/commandw/restart.sh "reboot" > /dev/null 2>&1 &
Code: Select all
bash /home/pi/domoticz/scripts/audio_shutdown.sh
2018-05-16 17:48:20.071 User: admin initiated a switch command (232/test/Off)
2018-05-16 17:48:20.203 (Virtual Switch) Light/Switch (test)
2018-05-16 17:48:20.289 Executing script: /home/pi/domoticz/scripts/audio_shutdown.sh
2018-05-16 17:48:20.302 Error: Error executing script command (/home/pi/domoticz/scripts/audio_shutdown.sh). returned: 32512
Does anybody of you have any idea of what's happening?
Thanks for your help

EDIT 1: 1 step forward:
I created a new file and copy / pasted my script into it then saved as audio_shutdown.sh and i now get this when executed:
Code: Select all
2018-05-16 18:03:14.219 User: admin initiated a switch command (232/test/On)
2018-05-16 18:03:14.352 (Virtual Switch) Light/Switch (test)
2018-05-16 18:03:14.439 Executing script: /home/pi/domoticz/scripts/audio_shutdown.sh
2018-05-16 18:03:14.452 Error: Error executing script command (/home/pi/domoticz/scripts/audio_shutdown.sh).[b] returned: 512 [/b]
I was able to get another step forward:
Had to save my script in a notepad and importing it in domoticz (notepad ++ didn't worked)
Now, no more error but script still doesen't work
EDIT 3: Last step : SOLVED: Last post:
Solved! YAY!!!!
Had to to with keys like @heggink pointed me:
Working command ignore keys as suggested in:
https://www.cyberciti.biz/faq/nonintera ... -provider/
Code: Select all
#!/bin/bash
sshpass -p "password" ssh -o StrictHostKeyChecking=no [email protected] sudo bash /var/local/www/commandw/restart.sh "reboot"
Thanks for your help and suggestions!

Top