Hauptmenü

How to run a bash script?

Begonnen von gthshsxth, 08 Januar 2015, 17:57:21

Vorheriges Thema - Nächstes Thema

gthshsxth

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)
But on the desktop file has not been created file.txt
As script.sh fhem run to set up file.txt?

DerFrickler

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.