From 6d8d31a3656a622ab82a3b26c8d45d5026313993 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 23 Nov 2010 12:08:49 +0100 Subject: Separate subject and recipients, and rename function to more generic doit(). --- sms.d/phone | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sms.d') diff --git a/sms.d/phone b/sms.d/phone index 4e4ddd7..4e08104 100755 --- a/sms.d/phone +++ b/sms.d/phone @@ -15,10 +15,13 @@ export smtp=mail.bitbase.dk export from=hp@fossasia.org export sender="$from" -# Send message (...just to stdout if invoking from cmdline) -sendit() { +mail_subject="[sms] phone $sms_fromphone" +mail_recipients="hp@fossasia.org mb@fossasia.org" + +doit() { + # Send message (...to stdout if invoked from cmdline) if [ -n "$sms_phone" ]; then - mail -s "[sms] phone $sms_fromphone" hp@fossasia.org mb@fossasia.org + mail -s "$mail_subject" $mail_recipients else cat fi @@ -27,7 +30,7 @@ sendit() { # Check keyword and break after processing if it matches case "$app" in phone) - cat <