Skip to content

Instantly share code, notes, and snippets.

View addisonj's full-sized avatar

Addison Higham addisonj

View GitHub Profile
#!/bin/bash
echo "Failure mode test suite for bash"
echo " running bash $BASH_VERSION"
try() {
trap 'echo FAILS' EXIT
case $1 in
simple)
printf " %-34s" "simple failed command"
@addisonj
addisonj / rm-corrupt.sh
Last active December 23, 2015 05:28 — forked from codepunkt/rm-corrupt.sh
Checks all the wsp files in a whisper storage and deletes any corrupt files
#!/bin/bash
matches=()
directory='/opt/graphite/storage/whisper'
for file in $(find $directory -type f -name '*.wsp' -print); do
$(python /usr/local/bin/whisper-info.py $file > /dev/null 2>&1)
retval=$?
echo "checking $file"
[ $retval -ne 0 ] && matches+=($file)