Actually, this if statement is useless - this script is set -e, so if $? is not 0, you'll never get past the ldapmodify line. Just write the touch line directly.