Created
July 14, 2010 06:41
-
-
Save orymate/475106 to your computer and use it in GitHub Desktop.
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 | |
ECHO=echo | |
if [ "x$DISPLAY" != x ] | |
then | |
if type -P zenity &>/dev/null | |
then | |
ECHO='zenity --info --text' | |
elif type -P xmessage &>/dev/null | |
then | |
ECHO='xmessage' | |
else | |
echo 'wtf :(' | |
fi | |
fi | |
while [ "x$1" != x ] | |
do | |
cd "$(dirname "$1")" | |
if grep -q SHA1 <<<"$1" | |
then | |
$ECHO "$(sha1sum -c $1)" | |
elif grep -q MD5 <<<"$1" | |
then | |
$ECHO "$(md5sum -c $1)" | |
else | |
$ECHO "What is $1?" | |
fi | |
shift | |
cd - | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment