Improve bash scripts, add global script