Fix deploy script.

TODO: if the machine hasn't got sudo then the script will fail ungracefully.
We need to account for that case too.