Used some smart bash calls to determine script path and use it instead of hard-coded values.