Last active
March 4, 2016 13:19
-
-
Save coderbyheart/29bc3ec786ee5c93b48b to your computer and use it in GitHub Desktop.
pin.sh
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
#!/bin/bash | |
# Use pin.sh to prevent accidently repeating of dangerous commands | |
# Usage: | |
# $ pin.sh rm -rf / | |
# $ Please type the PIN 7945 to continue: 1234 | |
# $ Sorry :-( | |
PIN="$(((RANDOM % 9)+1))$(((RANDOM % 9)+1))$(((RANDOM % 9)+1))$(((RANDOM % 9)+1))" | |
echo -n "Please type the PIN $PIN to continue: " | |
read TYPEDPIN | |
if [ "$TYPEDPIN" = "$PIN" ]; | |
then | |
$* | |
else | |
echo "Sorry :-("; | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment