summaryrefslogtreecommitdiff
path: root/sms.d
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-11-23 12:08:49 +0100
committerJonas Smedegaard <dr@jones.dk>2010-11-23 12:08:49 +0100
commit6d8d31a3656a622ab82a3b26c8d45d5026313993 (patch)
tree685c6bf93b4896ace80598b0fd481b2dd0a6e4cc /sms.d
parent89cd0fd2f6ba95fda7eced0a5ff9786253d8537b (diff)
Separate subject and recipients, and rename function to more generic doit().
Diffstat (limited to 'sms.d')
-rwxr-xr-xsms.d/phone11
1 files changed, 7 insertions, 4 deletions
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 <<EOF | sendit
+ cat <<EOF | doit
Someone at $sms_fromphone sent an sms to $sms_phone with keyword phone
and this message (supposedly his/her name):
$msg