Any reason not to just add both $HADOOP_HOME/etc/hadoop and $HADOOP_HOME/conf every time? In my experience the hadoop scripts can look different in different distributions, it might be good to just set both rather than relying on anything specific to the format of the scripts.