You don't need to store in a variable as you can use the exit code directly. First turn to common utilities like 'id' and such, else use something like 'awk' or 'grep', so why not simply
Code:
id apache >/dev/null|| adduser --lotsa-args
? Of course the user name has to be unique for such an example to work.