Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id C8F1D781062 for <~alpine/aports@lists.alpinelinux.org>; Sat, 10 Oct 2020 13:59:44 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=misterbanal.net; s=default; t=1602338384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wxrc3WyN0t5qQjwg0Tbk1LpTdEtTTpVaAaNa3CyAsfo=; b=WFwWFHJ85SjeHUzST8/tllKKvmnRd23mJHbXPI0vrOmlnYcMjKtTZaBDA4o8zVzlNGRAz+ aF7txHTV1rdykEA0tnjShbL39MJ1DYoseETP31dZonIt2jrsrpcAaNnWfj0JA8xKlHC88t BhHHeEIA7GigQDFIHaasLetMU7dJh1Q= From: Reed Wade To: ~alpine/aports@lists.alpinelinux.org Subject: [PATCH sxmo-utils v5 4/8] fix sending sms containing quotes Date: Sat, 10 Oct 2020 15:59:31 +0200 Message-Id: <20201010135935.19235-4-reedwade@misterbanal.net> In-Reply-To: <20201010135935.19235-1-reedwade@misterbanal.net> References: <20201010135935.19235-1-reedwade@misterbanal.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 4.90 Signed-off-by: Reed Wade --- scripts/modem/sxmo_modemsendsms.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/modem/sxmo_modemsendsms.sh b/scripts/modem/sxmo_modemsendsms.sh index 9910dae..df40ae9 100755 --- a/scripts/modem/sxmo_modemsendsms.sh +++ b/scripts/modem/sxmo_modemsendsms.sh @@ -32,10 +32,11 @@ else TEXT="$@" fi +TEXT="$(echo "$TEXT" | sed "s/\"/'/g" | sed "s/\`/'/g")" TEXTSIZE="${#TEXT}" SMSNO="$( - mmcli -m "$MODEM" --messaging-create-sms="text='$TEXT',number=$NUMBER" | + mmcli -m "$MODEM" --messaging-create-sms="text=\"$TEXT\",number=$NUMBER" | grep -o "[0-9]*$" )" mmcli -s "${SMSNO}" --send || err "Couldn't send text message" -- 2.28.0