Added some permission handling. Added shutdown, reboot command.