completly rewritten init.d script