add some useful bash function for start up scripts
Merge branch 'master' into 12.04