Prefix commands with sudo if not running as root

Signed-off-by: Gianpaolo Macario <gmacario@gmail.com>