How does it happen that the "os_execute" statement does not execute my send_mail.sh file in its entirety?
Explanations: I have a file send_mail.sh whose contents are as follows:
#!/usr/bin/env bash echo " " > /home/pi/doorpi/mail.txt echo "On a sonné à la porte!" > /home/pi/doorpi/mail.txt echo "Date: " `date` >> /home/pi/doorpi/mail.txt cat /home/pi/doorpi/mail.txt | mutt -s "il y a quelqu un à la porte!" firstname.lastname@example.org
The first echo deletes the text file mail.txt.
The second echo put the text "We rang the door!" In the text file mail.txt.
The third echo sets the date in the text file mail.txt.
The cat (with mutt) statement must send the contents of the mail.txt file to the e-mail address email@example.com
Now in doorpi.ini, the "os_execute" statement does not execute my file send_mail.sh:
[keyboards] onboardpins = gpio [onboardpins_InputPins] 11 = sleep:0 [EVENT_OnKeyUp_onboardpins.11] 30 = os_execute:/home/pi/doorpi/envoi_mail.sh
I do not receive the message in my mail firstname.lastname@example.org
While the sending date appears in the mail.txt file.
Does anyone understand something?
My file send_mail.sh works because when I click on it (on the file sendmail.sh) I send and I receive the message in my mail.
For me Doorpi does not execute the cat command.
If someone has an idea...