Remove duplicate code from init

The Debian init script contains duplicate code. This should be removed and put into functions, just like the syslog-ng init script ;)