GithubHelp home page GithubHelp logo

cant exec shell script about ha-bridge HOT 4 OPEN

lybserv2 avatar lybserv2 commented on June 30, 2024
cant exec shell script

from ha-bridge.

Comments (4)

bwssytems avatar bwssytems commented on June 30, 2024

Unfortunately, you still need to preface the command with "sh" as there is no environment settings in the exec from the system. Try "sh /home/pi/ac_off.sh"

from ha-bridge.

v4mp1 avatar v4mp1 commented on June 30, 2024

I had the same problem, did not matter if I executed it directly or as script or as systemctl service. Nothing worked.
The solution was my service wanted to run as user and not root.
But my ha-bridge was started as root and not user.

Check if midea-beautiful-air-cli has to be executed as user and if yoa ure running ha-bridge as root.
Both together does not work, at least in my example.

You can run ha-bridge as user if you set the port outside of the privileged port range (1-1023):

java -jar -Dserver.port=31337 ha-bridge-v5.4.1.jar
http://YourIP:31337

Edit:

Ok but with a port other than 80, Alexa could not find my ha-bridge devices.
Now I was in a dilemma, my commadn which I launch through the script only works as user but I can not launch ha-bridge as user.
The solution was to give java the rights to run it on port 80 as user:

sudo apt-get install libcap2-bin
sudo setcap cap_net_bind_service=+ep $(readlink -f java)
java -jar ha-bridge-v5.4.1.jar

Maybe this helps someone.
I just want to make it clear again, the script itself running within ha-brdige was not my problem.
The problem was the command in the script had to be run as user.

from ha-bridge.

lacojim avatar lacojim commented on June 30, 2024

Edit:

Ok but with a port other than 80, Alexa could not find my ha-bridge devices. Now I was in a dilemma, my commadn which I launch through the script only works as user but I can not launch ha-bridge as user. The solution was to give java the rights to run it on port 80 as user:

Maybe this helps someone. I just want to make it clear again, the script itself running within ha-brdige was not my problem. The problem was the command in the script had to be run as user.

I actually ran into both these issues a few weeks ago. I moved HA-Bridge to port 85 so I could free up 80 for something else. Wrong! Broke pretty much everything. Then I had set up a script to control an Onkyo receiver. Could not make it work at all until I changed the commands WITHIN the script to run as su -c "command" username

from ha-bridge.

arnieSkyNet avatar arnieSkyNet commented on June 30, 2024

I use they x-10 heyu software to operate lots of things, and if I assigned an operation that wasn't part of they heyu (like irclient from irtrans) into a heyu alias, I found it called any shell/script, avoiding the "sh" thing.

I presume heyu adds a shell.

from ha-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.