#!/bin/bash #TODO - make the showmsgs script the centerpiece #TODO - is daemon running? Kill daemon trigger here as well. #TODO - PHONEBOOK #TODO - force read #TODO - lockfile for daemon process & force read #if [ $1 = "send" ] #then #if [ $# -ne 3 ] # then #echo -e "\E[0;36mPlease input your message."; tput sgr0 # read message # echo -e "\E[0;34mPlease input the number."; tput sgr0 #read number # fi #echo "$message" | gammu --sendsms TEXT $number #fi #echo $1 #echo $2 #echo $3 #echo $# #this checks for new messages - it's the default if no command line options. for i in /home/steven/opt/spool/gammu/inbox/*_unread.txt; do echo -e "\E[0;34m########################################################"; tput sgr0 #getting a fault if i is nothing. Whoops. if [ -f $i ] then cat $i echo -e "\E[0;32m(\E[0;37mr\E[0;32m)eply, (\E[0;37mm\E[0;32m)ark read, (\E[0;37mk\E[0;32m)eep unread? "; tput sgr0 read CHOICE case "$CHOICE" in "r") echo -e "\E[0;36mPlease input your message."; tput sgr0 read message #echo $i number=`head -1 $i` echo "$message" | gammu --sendsms TEXT $number mv "$i" "${i/_unread.txt}"_read.txt ;; "m") echo "marking as read" mv "$i" "${i/_unread.txt}"_read.txt ;; "*") echo "keeping unread, no notify" ;; esac fi done; if [ -f /home/steven/opt/spool/gammu/.notify ] then rm /home/steven/opt/spool/gammu/.notify fi # #while true; do #gammu --geteachsms > /tmp/gammu_sms.tmp #./smsparser #if [ -f /home/steven/opt/spool/gammu/.notify ] # then # notify-send --icon=blueman "Text Message Recieved" #fi ## to be marking them as read... ## for i in *.txt; do mv "$i" "${i/_unread.txt}"_read.txt; done #code #sleep 120 #done