# Exec Befehle hilfe

**URL:** <https://discourse.nodered.org/t/exec-befehle-hilfe/78361>\
**Category:** General\
**Tags:** docker\
**Created:** [11 May 2023 16:35 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361 "2023-05-11T16:35:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shwowak](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shwowak](https://discourse.nodered.org/u/Shwowak)\
**Post date:** [11 May 2023 16:35 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/1 "2023-05-11T16:35:00Z")

</div>

bash /data/evcc.sh

Die evcc.sh

```auto
#!/bin/bash

 sudo docker pull evcc/evcc:latest 
 sudo docker stop evcc
 sudo docker rm evcc
 cd /home/pi/smarthome
 sudo docker-compose up -d

```

Nodered Debug : `/data/evcc.sh: line 3: sudo: command not found /data/evcc.sh: line 4: sudo: command not found /data/evcc.sh: line 5: sudo: command not found /data/evcc.sh: line 6: cd: /home/pi/smarthome: No such file or directory /data/evcc.sh: line 7: sudo: command not found`

---

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [11 May 2023 16:47 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/2 "2023-05-11T16:47:02Z")

</div>

A bit more information might be necessary to get a helpful answer.  
Are you trying to execute docker commands from inside a docker container (I assumed this because of /data path being used)?

---

<div class="post-metadata">

**Author:** ![Shwowak](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shwowak](https://discourse.nodered.org/u/Shwowak)\
**Post date:** [11 May 2023 16:59 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/3 "2023-05-11T16:59:50Z")

</div>

Thx for answer. Yes Nodered Run in docker. /home/pi/smarthome/nodered

in Nodered is the pfad from Nodered = /data/

the Fiel evcc.sh is on /home/pi/smarthome/nodered/evcc.sh or in Nodered is it the pfad /data/evcc.sh

---

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [11 May 2023 18:43 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/4 "2023-05-11T18:43:35Z")

</div>

Ok, aber innerhalb vom Docker Container wird es nicht ohne weiteres möglich sein Docker zu steuern. Was genau ist das Ziel der Übung?  
Wenn es nur darum geht den Container zu aktualisieren, gibt es bessere Wege, zum Beispiel watchtower.

---

<div class="post-metadata">

**Author:** ![Shwowak](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shwowak](https://discourse.nodered.org/u/Shwowak)\
**Post date:** [13 May 2023 10:58 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/5 "2023-05-13T10:58:43Z")

</div>

Watch over updates alle Container ich möchte nur evcc updaten und das per Butten auf dem Dashboard

---

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [13 May 2023 12:47 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/6 "2023-05-13T12:47:20Z")

</div>

Honestly, I have difficulties to understand what you mean. I thought it would be easier in German...

A quick search gave me this link [deployment - Automatically update Docker containers using webhooks - Server Fault](https://serverfault.com/questions/677059/automatically-update-docker-containers-using-webhooks) where something called [docker-image-puller](https://github.com/tuxity/docker-image-puller) is mentioned. Maybe you can add that to your node-red stack and trigger it via webhook.  
Or you create a python script to update the image and restart the container directly. Source of this docker-image-puller might give you ideas.

---

<div class="post-metadata">

**Author:** ![Shwowak](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shwowak](https://discourse.nodered.org/u/Shwowak)\
**Post date:** [16 May 2023 23:08 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/7 "2023-05-16T23:08:13Z")

</div>

In nodered there is the ecec node, you can feed it with commands, for example. sudo reboot ... this does not work . debug;object  
Code: 127  
Message: "Command failed: sudo reboot↵/bin/bash: line 1: sudo: command not found↵"

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [17 May 2023 05:35 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/8 "2023-05-17T05:35:52Z")

</div>

> <https://stackoverflow.com/questions/25845538/how-to-use-sudo-inside-a-docker-container>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 July 2023 05:36 UTC](https://discourse.nodered.org/t/exec-befehle-hilfe/78361/9 "2023-07-16T05:36:38Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
