updated variable name

This commit is contained in:
2022-05-20 18:16:15 -04:00
parent 0c72917c87
commit 83718e6037

View File

@@ -9,7 +9,7 @@ LOG_FILE="/tmp/Ubiquiti Stock ${NAME}.log"
echo "" > "${LOG_FILE}"
echo "URL: ${URL}" | tee -a "${LOG_FILE}"
echo "Email: ${Email}" | 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" ${Email}
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}"