4 SCRIPTNAME
=termux-sms-send
6 echo "Usage: $SCRIPTNAME [-t <text>] <recipient-number>"
9 echo " -t <text> text to send (optional - else from stdin)"
11 echo "If no text is specified with the -t option the text to send is read from stdin."
16 while getopts :ht
: option
20 t
) TEXT_TO_SEND
="$OPTARG";;
21 ?
) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
26 if [ $# = 0 ]; then echo "$SCRIPTNAME: too few arguments"; exit 1; fi
27 if [ $# -gt
1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
29 CMD
="@TERMUX_API@ SmsSend --es recipient $1"
30 if [ -z
"$TEXT_TO_SEND" ]; then
33 echo $TEXT_TO_SEND |
$CMD