Skip to content

Instantly share code, notes, and snippets.

@sc137
Created September 7, 2012 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sc137/3670439 to your computer and use it in GitHub Desktop.
Save sc137/3670439 to your computer and use it in GitHub Desktop.
Bash script to first check that you are root ...
#!/bin/bash
if [ "$(id -u)" != 0 ]; then
echo "Please run this as root."
exit 1
fi
echo "Success! You are root!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment