I have part of a script that i can't figure out. I want the script to check if the app is running. I set parameter to check for the app using a function. SO in my test i would like to see if the app is running it would return with a 0 and complete my IF statement, and if if the app is not running it would return with a 1 and tell me to check again. i'm not sure what is the best approach for something like that. Below is something i had in mind. Sorry for the confusion earlier
function appRunning {
pgrep Dialog && return 0 || return
}
if [ x$(appRunning) = '0' ] ; then
echo " yes app is running"
else
echo "no app is not running please check again
fi
...
exit 0
`