Use single equal to sign for comparison

this was causing the script to throw error, and fall to the "else" part even when the strings were different
Reformat. Dont duplicate code
Merge branch 'master' of http://github.com/rushiagr/pipeline