The PS updates post apply job and moves execution of the command outside
of if statement. The output of the command stored in a variable
which will be checked in if statement. Added "-z" to correct comparison
of the length of the string (variable). It was accidentally missed in
the initial PS.
Change-Id: I907f75d0a9e5ef27fba5306ddb86199e94b01b3b