all credits to https://github.com/Hexxeh/rpi-update