Page 1 of 1

SOLVED Error 1536 while Running a Bash script, shutting down a Linux Mashine

Posted: Saturday 16 February 2019 22:52
by lara
hi Lara here,

i have problems running a schript on a dummy switch trigger, here is the error message i get:

Code: Select all

2019-02-16 21:13:56.746  Error: Error executing script command 
(/home/pi/domoticz/scripts/sh/shutdownfile.sh). returned: 1536
i try to shut down a Debian server i use to store my files, it is running openmediavault.
the thing is, running the script from the raspberry pies cmd per ssh works fine but when i try to call the script jusing domoticz I just get that error.

here is said script

Code: Select all

#!/bin/bash
sshpass -p 'Password' ssh -t root@Address 'shutdown -h now'
#shuts down a linux client with given adress
i have made the schript escutable and a call of etherwake with another call works fine that looks like this

Code: Select all

#!/bin/bash
wakeonlan MAC-Address
#sends magic package vor given adress.

- kind regards Lara -

Re: Error 1536 while Running a Bash script, shutting down a Linux Mashine

Posted: Saturday 16 February 2019 23:05
by waaren
lara wrote: Saturday 16 February 2019 22:52 i have problems running a schript on a dummy switch trigger, here is the error message i get:
returned: 1536

Code: Select all

#!/bin/bash
sshpass -p 'Password' ssh -t root@Address 'shutdown -h now'
Check this where it is advised to first execute the script (as the same user running domoticz) without the sshpass.

Re: Error 1536 while Running a Bash script, shutting down a Linux Mashine

Posted: Saturday 16 February 2019 23:31
by lara
I totally forgot that Domotics may run as a different user, it is running as root and i had to type "yes" to allow to add the fingerprint :lol: :oops:

it is working now though it now trwos a :

Code: Select all

2019-02-16 22:25:37.482  Error: Error executing script command
 (/home/pi/domoticz/scripts/sh/shutdownfile.sh). returned: 65280
on another note, do you a "Hardware" that just sends and reads devices on the serial bus ? if so please point me the right way, so i don't have to write my own plugin compleatly :3

- kind regards Lara -