summaryrefslogtreecommitdiff
path: root/sms.d/phone
blob: 69e8ad500b6417eb50228d94e80078e56c33d533 (plain)
  1. #!/bin/sh
  2. # if an error occurs, break immediately
  3. set -e
  4. # Variables from Kannel sms gateway
  5. sms_phone="$SMS_PHONE"
  6. sms_fromphone="$1"
  7. app="$2"
  8. shift 2
  9. msg="$*"
  10. # Settings for the "mail" outgoing email command
  11. export smtp=mail.bitbase.dk
  12. export from=hp@fossasia.org
  13. export sender="$from"
  14. # Check keyword and break after processing if it matches
  15. case "$app" in
  16. phone)
  17. cat <<EOF | mail -s "[sms] phone $sms_fromphone" hp@fossasia.org mb@fossasia.org
  18. Someone at $sms_fromphone sent an sms to $sms_phone with keyword phone
  19. and this message (supposedly his/her name):
  20. $msg
  21. EOF
  22. exit 1
  23. ;;
  24. esac