Can execute script from putty but not from domoticz

Moderator: leecollings

Post Reply
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Can execute script from putty but not from domoticz

Post by burton666 »

I have placed a script in the /script folder and have verified that it works by running ./script.sh.
But I can't get it to work from domoticz.

Code: Select all

Executing script: /home/pi/domoticz/scripts/datorrum_toggle.sh
Error: Error executing script command (/home/pi/domoticz/scripts/datorrum_toggle.sh). returned: 32512
This is what I have tried under the script option: script://home/pi/domoticz/scripts/datorrum_toggle.sh and also script://datorrum_toggle.sh
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can execute script from putty but not from domoticz

Post by Sneezydevil »

You might need 3 slashes.

Code: Select all

script:///home/pi/domoticz/scripts/datorrum_toggle.sh
Was an update at some point I think.
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can execute script from putty but not from domoticz

Post by burton666 »

That did not work either.

when I run ls -l every script is "owned" by "pi" but the script I am trying to run looks like this:

Code: Select all

-rwxrwxrwx 1 root root    83 Feb 15 18:24 datorrum_toggle.sh
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can execute script from putty but not from domoticz

Post by burton666 »

this is the script:

Code: Select all


#!/bin/bash

sudo ./wemo_control.sh 192.168.0.200 LINK datorrum TOGGLE  > /dev/null
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can execute script from putty but not from domoticz

Post by Sneezydevil »

Try using the entire path in the script like:

Code: Select all

/home/pi/domoticz/scripts/wemo_control.sh
And doesnt sudo ask for a password? I login on so many different stations I can't remember default behavior for a pi.
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can execute script from putty but not from domoticz

Post by burton666 »

Tried that to without success.

I chaged the path in the script to ~/domoticz/scripts/wemo_control.sh
and I am able to run it by ./datorrum_toggle.sh or ~/domoticz/scripts/datorrum_toggle.sh. everything works fine in putty but nothing works from domoticz.

When I run sudo it does not ask for password
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can execute script from putty but not from domoticz

Post by burton666 »

I logged in to root by sudo su and if I run the same script from there I get:

Code: Select all

root@raspberrypi:/home/pi/domoticz/scripts# ./datorrum_toggle.sh
./datorrum_toggle.sh: line 3: ./home/pi/domoticz/scripts/wemo_control.sh: No such file or directory
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: Can execute script from putty but not from domoticz

Post by Westcott »

I don't think that './home/pi/domoticz/scripts/wemo_control.sh' should start with a dot.
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can execute script from putty but not from domoticz

Post by burton666 »

I removed the dot in the beginning of the script and it then worked.

Code: Select all

#!/bin/bash

/home/pi/domoticz/scripts/wemo_control.sh 192.168.0.200 LINK datorrum TOGGLE  > /dev/null
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest