I simply want to check and see if iTunes is running, if it is -- do nothing, if it isn't -- custom trigger to update it.
This seems to be working for everything I throw at it except iTunes. Looks like ps is picking up iTunesHelper even when iTunes is quit. Any suggestions here?
process="iTunes"
processrunning=$( ps axc | grep "${process}" )
if [ "$processrunning" != "" ]; then
/bin/echo "$process IS running, we do nothing now"
else
/bin/echo "$process IS NOT running - run custom trigger here to update"
fi