Skip to content

Instantly share code, notes, and snippets.

@SofianeHamlaoui
Created September 11, 2019 22:51
Show Gist options
  • Save SofianeHamlaoui/0988b9a5296d8b1653ffcdde843c88e0 to your computer and use it in GitHub Desktop.
Save SofianeHamlaoui/0988b9a5296d8b1653ffcdde843c88e0 to your computer and use it in GitHub Desktop.
Check for Root permissions on bash
function checkroot {
showlogo && sleep 1
if [[ $(id -u) = 0 ]]; then
echo -e " Checking For ROOT: ${g}PASSED${endc}"
else
echo -e " Checking For ROOT: ${r}FAILED${endc}
${y}This Script Needs To Run As ROOT${endc}"
echo -e " ${b}Lockdoor Installer${enda} Will Now Exit"
echo
sleep 1
exit
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment