Add some improvements to init script.

Added restart support.