Created
February 23, 2017 21:17
-
-
Save NeilHanlon/65992006e97a718f2f8246efb16c3646 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 | |
baddisks=() | |
for disk in "/" "/disk2" "/disk3" ; do | |
if [[ -d ${disk} ]]; then | |
touch ${disk}/test 2>/dev/null || baddisks+=(${disk}) | |
rm ${disk}/test 2>/dev/null | |
fi | |
done | |
count="${#baddisks[@]}" | |
if (( ${count} > 0 )); then | |
echo "${baddisks[@]}" | |
exit ${count} | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment