Run entire shell script as root
$ #!/usr/bin/sudo /bin/bash
Placing sudo in the shebang line of a shell script runs the entire thing as root. Useful for scripts designed to, e.g. automate system upgrades or package manager wrappers — makes prepending everything with sudo no longer necessary
Diff your entire server config at ScriptRock.com