FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: gthshsxth am 08 Januar 2015, 17:57:21

Titel: How to run a bash script?
Beitrag von: gthshsxth am 08 Januar 2015, 17:57:21
Hello!

I have a bash script.sh
#!/bin/bash

echo > /home/pic/Desktop/file.txt

I want to run this script.sh from the fhem
So I added a file fhem.cfg such a line
define TuerNotify notify { system("/home/pic/Desktop/script.sh") }

(http://s24.postimg.org/4s907sg81/2015_01_08_183724_860x616_scrot.jpg) (http://postimg.org/image/4s907sg81/)
But on the desktop file has not been created file.txt
As script.sh fhem run to set up file.txt?
Titel: Antw:How to run a bash script?
Beitrag von: DerFrickler am 08 Januar 2015, 19:07:59
does fhem has writing permission in the directory you want to create the file? you should take care about what is possible to execute in the console directly (maybe as root) and what is executed from fhem with fhem-user permission.