but if the the script is fired via a switch in domoticz the created file is owned by "root" and the sms daemon "smsd" cannot acces the file.
for those who dont know sms server tools yet, its a sms gateway daemon which is monitoring a spool directory waiting for text files in /outgoing and moves them to /sent when everything worked
the script itself is pretty simple, but with my humble linux knowledge I would apprentice a good solution
Iam running 2.3530 domoticz raspberry image and the spool directory is in /home/pi/sms/ with its subdirectorys
Code: Select all
#!/bin/bash
today=`date '+%Y_%m_%d__%H_%M_%S'`;
sudo -u smsd echo "To: 436XXXXXXXXXXX
WAN is not reachable" >> "/home/pi/sms/outgoing/`date '+%Y_%m_%d__%H_%M_%S'`.txt"