Improve init script

Fixes https://github.com/serverdensity/sd-agent/issues/67