blob: 4e4ddd7fc4dd3f54504f3cd62b3a4295650c4a82 (
plain)
- #!/bin/sh
- # if an error occurs, break immediately
- set -e
- # Variables from Kannel sms gateway
- sms_phone="$SMS_PHONE"
- sms_fromphone="$1"
- app="$2"
- shift 2
- msg="$*"
- # Settings for the "mail" outgoing email command
- export smtp=mail.bitbase.dk
- export from=hp@fossasia.org
- export sender="$from"
- # Send message (...just to stdout if invoking from cmdline)
- sendit() {
- if [ -n "$sms_phone" ]; then
- mail -s "[sms] phone $sms_fromphone" hp@fossasia.org mb@fossasia.org
- else
- cat
- fi
- }
- # Check keyword and break after processing if it matches
- case "$app" in
- phone)
- cat <<EOF | sendit
- Someone at $sms_fromphone sent an sms to $sms_phone with keyword phone
- and this message (supposedly his/her name):
- $msg
- EOF
- exit 1
- ;;
- esac
|