Skip to content

Instantly share code, notes, and snippets.

@jcefoli
Last active March 12, 2020 15:46
Show Gist options
  • Save jcefoli/0eb8f54b4307ecf0c0620141bf5c9b48 to your computer and use it in GitHub Desktop.
Save jcefoli/0eb8f54b4307ecf0c0620141bf5c9b48 to your computer and use it in GitHub Desktop.
Check for Root
#!/usr/bin/env bash
if [ "$(whoami)" != "root" ]; then
echo -e "Sorry, you are not running as root.\nPlease run this script as root.\n\nExiting...";
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment