[SERVER-6008] put the logic for DAEMON_OPTS= and -- into the "if which n...

I signed the contributors agreement, and referenced the relevant ticket. I probably wont make a jira account (sorry?)