Skip to content

Commit 729fd17

Browse files
author
André Marçais
committed
termux-sms-send takes sim argument.
1 parent 34b8d6a commit 729fd17

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

scripts/termux-sms-send

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ set -e -u
33

44
SCRIPTNAME=termux-sms-send
55
show_usage () {
6-
echo "Usage: $SCRIPTNAME -n number[,number2,number3,...] [text]"
6+
echo "Usage: $SCRIPTNAME -n number[,number2,number3,...] [-s slot] [text]"
77
echo "Send a SMS message to the specified recipient number(s). The text to send is either supplied as arguments or read from stdin if no arguments are given."
88
echo " -n number(s) recipient number(s) - separate multiple numbers by commas"
9+
echo " -s sim slot to use"
910
exit 0
1011
}
1112

1213
RECIPIENTS=""
13-
while getopts :hn: option
14+
SLOT=""
15+
while getopts :hn:s: option
1416
do
1517
case "$option" in
1618
h) show_usage;;
1719
n) RECIPIENTS="--esa recipients $OPTARG";;
20+
s) SLOT="--ei slot $OPTARG ";;
1821
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
1922
esac
2023
done
@@ -24,7 +27,7 @@ if [ -z "$RECIPIENTS" ]; then
2427
echo "$SCRIPTNAME: no recipient number given"; exit 1;
2528
fi
2629

27-
CMD="@TERMUX_PREFIX@/libexec/termux-api SmsSend $RECIPIENTS"
30+
CMD="@TERMUX_PREFIX@/libexec/termux-api SmsSend $RECIPIENTS $SLOT"
2831
if [ $# = 0 ]; then
2932
$CMD
3033
else

0 commit comments

Comments
 (0)