Created
July 1, 2019 22:04
-
-
Save Shivakishore14/bdac680be4de027cae0a171f007fcef8 to your computer and use it in GitHub Desktop.
sudo_fun_hack_script
This file contains 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
function sudo_() { | |
args="$@" | |
echo $args | |
flag=0 | |
sudo touch /usr/bin/samplesec.txt &> /dev/null | |
if [ "$?" -eq 0 ]; then | |
flag=1 | |
sudo $args | |
fi | |
while [ $flag -eq 0 ]; do | |
echo "Enter password :" | |
read pass | |
echo $pass | sudo -S touch /usr/bin/samplesec.txt &> /dev/null | |
if [ "$?" -eq 0 ]; then | |
sudo $args | |
break | |
fi | |
echo "Sorry, try again" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment