changed to more readable code after reading sysvinit source code
added poweroff and reboot commands