Created
February 13, 2014 07:13
-
-
Save bageljp/8971096 to your computer and use it in GitHub Desktop.
mount check
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 | |
FL_CHECK=".health_check.html.`hostname`" | |
MESSAGE="" | |
LIST_MOUNT[0]="/var/www/html/contents" | |
ret=0 | |
flg_err=0 | |
for i in ${LIST_MOUNT[@]}; do | |
rm -f "${i}/${FL_CHECK}" | |
echo "`date +'%Y/%m/%d %H:%M:%S'` `hostname`" > "${i}/${FL_CHECK}" | |
ret=$? | |
if [ ${ret} -eq 0 ]; then | |
MESSAGE=`echo -e "${MESSAGE} \n${i} : OK"` | |
else | |
MESSAGE=`echo -e "${MESSAGE} \n${i} : ERROR"` | |
flg_err=1 | |
fi | |
done | |
if [ ${flg_err} -eq 0 ]; then | |
echo -e "mountpoint check is ALL OK.${MESSAGE}" | |
exit 0 | |
else | |
echo -e "mountpoint check is ERROR.${MESSAGE}" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment