refactor linux daemon script

change tabs to spaces and fix indent

use of $0 instead of hardcoded scriptname

change order of variables for user experience