Considerably simplified the init script to make them compatible with CentOS and the other distribution having LSB scripts.