From b352c50bb2283ccea450bb7aa4575f4230711bd5 Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Thu, 27 Jan 2022 19:18:51 -0500 Subject: [PATCH] added parameter for name --- ubiquiti_stock.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ubiquiti_stock.sh b/ubiquiti_stock.sh index 806e672..72e2f94 100644 --- a/ubiquiti_stock.sh +++ b/ubiquiti_stock.sh @@ -2,6 +2,7 @@ URL=${1} PHONE_NUMBER=${2} +NAME=${3} SOURCE_FILE='/tmp/source.html' @@ -10,7 +11,7 @@ wget -qO ${SOURCE_FILE} ${URL} INVENTORY_QUANTITY=$(grep -o -m 1 '"inventory_quantity":[0-9]\+,' ${SOURCE_FILE} | grep -o '[0-9]\+') if [[ "${INVENTORY_QUANTITY}" -gt "0" ]]; then - MESSAGE="There are currently ${INVENTORY_QUANTITY} in stock. ${URL}" + MESSAGE="There are currently ${INVENTORY_QUANTITY} ${NAME} in stock. ${URL}" echo "${MESSAGE}" echo "${PHONE_NUMBER}" echo "${MESSAGE}" | mailx -r "stockalerts@johnhgaunt.com" --set smtp="smtp.home.johnhgaunt.com:25" ${PHONE_NUMBER}@vtext.com