Better to let it sudo in the script

It seems that by default sudo doesn't require a password so no harm in
doing it within the script.