From 2d5302f56dccfc51a4ebc068bda0ac4d1eae2d43 Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Sun, 9 Jul 2023 14:23:32 -0700 Subject: [PATCH] Query UA Pay by Name Usage: uapay.sh FirstName LastName --- uapay.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/uapay.sh b/uapay.sh index 09d4a2a..b413025 100644 --- a/uapay.sh +++ b/uapay.sh @@ -51,9 +51,17 @@ uapay_filter="and a pay of" # Query URL uapay_output=$(curl -s -k --user-agent $uapay_useragent $uapay_url/$uapay_name-4329 | grep "$uapay_filter") +# Check output +{ +if [ -z "$uapay_output" ]; then + echo -e "\n$1 $2 was not found.\n" + exit 0 +fi +} + # Format output -#echo ${uapay_output/<\/p>/} uapay_output=${uapay_output/\

/} uapay_output=${uapay_output/\<\/p\>/} +# Print output echo -e "\n$uapay_output\n"