Last active
December 16, 2015 03:39
-
-
Save bichotll/5371262 to your computer and use it in GitHub Desktop.
Just a simple bash alert for sudo command. To do it permanent just copy it along your ".bash_profile" file of your home. Maybe it could save you from a "sudo rm / -R" because you forgot the "." before the slash...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#just a secure sudo | |
bic_sudo() { | |
echo -e "\e[0;31mAre you sure\e[00;m that you want to use sudo?"; | |
echo -e "\e[0;34mMaybe you can do it in other way..." | |
echo -e -n '\e[00m' | |
read suresudo; | |
if [ $suresudo == "yes" ] || [ $suresudo == "y" ] ; | |
then | |
sudo $@; | |
else | |
echo -e "Remember:\e[0;32mEvery time you do a bash mistake god kills a kitten" | |
echo -e -n '\e[00m' | |
fi | |
} | |
alias sudo='bic_sudo' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment