refactor init.d script using /etc/init.d/skeleton