Merge pull request #2 from handy-serge/master

SS-612 Pulled some updates from upstream.
debian compatibility and variable use

This patch fixes the use of `/etc/init.d/functions` which seems to be not standard across linux distributions. Furthermore the template now uses the global variables instead of the local ones / some functions.
formatting
fallback to hostname