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
# bourne shell functions below take 1 argument, the file_to_hash. | |
# prints hex digest on stdout | |
md5() { | |
perl -MDigest::MD5=md5_hex -le'print md5_hex(<> or die)' "$1" | |
# ruby -rdigest/md5 -e"puts Digest::MD5.file'/dev/null'" | |
# python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()" | |
# md5 "$1"|cut -d' ' -f4 # mac/bsd | |
# md5sum "$1"|cut -d' ' -f1 # linux | |
} |
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 | |
# An set of disks to ignore from partitioning and formatting | |
BLACKLIST="/dev/sda|/dev/sdb" | |
# Base directory to hold the data* files | |
DATA_BASE="/media" | |
usage() { | |
echo "Usage: $(basename $0) <new disk>" | |
} |