summaryrefslogtreecommitdiff
path: root/sms.d/phone
diff options
context:
space:
mode:
Diffstat (limited to 'sms.d/phone')
-rwxr-xr-xsms.d/phone11
1 files changed, 10 insertions, 1 deletions
diff --git a/sms.d/phone b/sms.d/phone
index 69e8ad5..4e4ddd7 100755
--- a/sms.d/phone
+++ b/sms.d/phone
@@ -15,10 +15,19 @@ 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 | mail -s "[sms] phone $sms_fromphone" hp@fossasia.org mb@fossasia.org
+ cat <<EOF | sendit
Someone at $sms_fromphone sent an sms to $sms_phone with keyword phone
and this message (supposedly his/her name):
$msg