Skip to content

Instantly share code, notes, and snippets.

@saintmalik
Last active April 3, 2022 14:21
Show Gist options
  • Save saintmalik/ae14a20e6475025b7ba5ba7df4cda46a to your computer and use it in GitHub Desktop.
Save saintmalik/ae14a20e6475025b7ba5ba7df4cda46a to your computer and use it in GitHub Desktop.
# !/bin/bash
bash data.sh | jq . > data.txt
result=$(cat data.txt | grep -e "successful" | wc -l)
if [ $result -eq 3 ]; then
echo "Success, Everyone got the topup 👍"
else
echo "Ahhh, we've got errors oooh 😂🤣😂"
fi
##You create a file named data.sh and declare users phone number as variable and add the data/airtime provider api, the `result == "3"` is because i have 3 curl url running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment