From 0c72917c87dd28a42e2f993345f2263e17f5ac34 Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Fri, 20 May 2022 18:14:13 -0400 Subject: [PATCH] updated to just use email instead of phone. updated log file variables --- ubiquiti_stock.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ubiquiti_stock.sh b/ubiquiti_stock.sh index f97b487..39c463d 100644 --- a/ubiquiti_stock.sh +++ b/ubiquiti_stock.sh @@ -1,16 +1,16 @@ #!/bin/bash URL=${1} -PHONE_NUMBER=${2} +EMAIL=${2} NAME=${3} LOG_FILE="/tmp/Ubiquiti Stock ${NAME}.log" echo "" > "${LOG_FILE}" -echo "URL: ${1}" | tee -a "${LOG_FILE}" -echo "Phone Number: ${2}" | tee -a "${LOG_FILE}" -echo "Name: ${3}" | tee -a "${LOG_FILE}" +echo "URL: ${URL}" | tee -a "${LOG_FILE}" +echo "Email: ${Email}" | tee -a "${LOG_FILE}" +echo "Name: ${Name}" | tee -a "${LOG_FILE}" SOURCE_FILE="/tmp/Ubiquiti Stock ${NAME}.source" @@ -25,7 +25,7 @@ echo "Inventory Quantity: ${INVENTORY_QUANTITY}" | tee -a "${LOG_FILE}" if [[ "${INVENTORY_QUANTITY}" -gt "0" ]]; then MESSAGE="There are currently ${INVENTORY_QUANTITY} ${NAME} in stock. ${URL}" echo "Message: ${MESSAGE}" | tee -a "${LOG_FILE}" - echo "${MESSAGE}" | mailx -r "stockalerts@johnhgaunt.com" --set smtp="smtp.home.johnhgaunt.com:25" ${PHONE_NUMBER}@vtext.com + echo "${MESSAGE}" | mailx -r "stockalerts@johnhgaunt.com" --set smtp="smtp.home.johnhgaunt.com:25" ${Email} echo "Email sent" | tee -a "${LOG_FILE}" else echo "Not sending email" | tee -a "${LOG_FILE}"