summaryrefslogtreecommitdiff
path: root/sms.d
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-11-23 08:50:28 +0100
committerJonas Smedegaard <dr@jones.dk>2010-11-23 09:08:50 +0100
commit89cd0fd2f6ba95fda7eced0a5ff9786253d8537b (patch)
tree5b83944b9f3c2bbea8eee3b0011dcccb5099ed36 /sms.d
parent3d21884475fd102e21d679cebbb119e33fb01479 (diff)
Ease testing: Just emit to screen if SMS_PHONE missing.
Diffstat (limited to 'sms.d')
-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