Created
July 11, 2018 09:01
-
-
Save atomtigerzoo/8af351154ad62a8714fe52ce7a3f13c6 to your computer and use it in GitHub Desktop.
Revisions
-
atomtigerzoo created this gist
Jul 11, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash MOUNTPOINT="/some/mount-point" EMAIL="[email protected]" if cat /proc/mounts | grep ${MOUNTPOINT} > /dev/null; then echo "${MOUNTPOINT} already mounted." exit 0 fi # If above did not exit mount ${MOUNTPOINT} if [ $? -eq 0 ]; then echo "${MOUNTPOINT} has been mounted." else # Mounting failed, send email echo "Mounting of ${MOUNTPOINT} failed." | mail -s "[server notification] Mount fail" $EMAIL fi exit