Skip to content

Commit

Permalink
Only allow one instance of sendPictureMail to run at once (EliasKotly…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dopeyr authored and jmtatsch committed Jun 23, 2018
1 parent 0bde313 commit c45769d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions firmware_mod/scripts/sendPictureMail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ fi

. /system/sdcard/config/sendmail.conf

if [ -f /tmp/sendPictureMail.lock ]; then
echo "sendPictureEmail already running, /tmp/sendPictureMail.lock is present"
exit 1
fi

touch /tmp/sendPictureMail.lock

# Build headers of the emails
{

Expand Down Expand Up @@ -63,3 +70,4 @@ printf '%s\n' "-- End --"
-H"exec /system/sdcard/bin/openssl s_client -quiet -connect $SERVER:$PORT -tls1 -starttls smtp" \
-f"$FROM" -au"$AUTH" -ap"$PASS" $TO 2>/dev/null

rm /tmp/sendPictureMail.lock

0 comments on commit c45769d

Please sign in to comment.