Make script work in Jenkins environment as well as outside