(fixed) Exec binding using passwordless ssh


my problem is that a script executed by exec binding that calls a remote script with passwordless ssh doesn’t return the exit code of the remote script. 255 is always the returned value.
If I execute the script as user abc in local bash shell it works well. abc is a standard user on the local and on the remote system.

Local script (/etc/openhab2/scripts/15_fsys_monitoring.sh):
/usr/bin/sudo /usr/bin/ssh -i /etc/openhab2/scripts/id_rsa_abc abc@$1 "sh /etc/openhab2/scripts/15_fsys_monitoring_remote.sh $2"
exit “$EC”

Remote script: (/etc/openhab2/scripts/15_fsys_monitoring_remote.sh)
STATUS=/bin/df -h $1 | /bin/grep '/dev' | /usr/bin/awk '{print $5}' FPAT='[0-9,]+'
exit $STATUS

Thing exec:command:fsys_used_root_zion [command="/etc/openhab2/scripts/15_fsys_monitoring.sh 192.x.x.x /", interval=600, timeout=10]

Number dfr_fsys_used_root_zion { channel=“exec:command:fsys_used_root_zion:exit” }

openhab ALL=(ALL) NOPASSWD: /usr/bin/ssh

/etc/openhab2/scripts (local):
-rwxr-xr-x 1 openhab openhab 167 Apr 25 13:55 15_fsys_monitoring.sh*
-r-------- 1 openhab openhab 1679 Apr 25 14:05 id_rsa_abc
-r-------- 1 openhab openhab 398 Apr 25 14:05 id_rsa_abc.pub

/etc/openhab2/scripts (remote):
-rwxr-xr-x 1 abc abc 116 Apr 25 14:46 15_fsys_monitoring_remote.sh*

There are no errors logged in /var/log/openhab.log or shown in karaf.
My question is how to locate the problem.

Thanks in advice …

Restarting OH2 after the last change seems to fix the problem.