Created
September 9, 2021 18:29
-
-
Save nickistre/f623d2c77e29dbb70b4429342eb21649 to your computer and use it in GitHub Desktop.
Script to watch for when a disk drops out
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 | |
# Infinite loop | |
for (( ; ; )) | |
do | |
for arg in "${@}" | |
do | |
if [ ! -e "${arg}" ] | |
then | |
echo "'${arg}' is gone" | |
date | |
exit 0 | |
fi | |
sleep 1 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment