Created
August 21, 2020 11:21
-
-
Save jezman/91e516aa1cca0b23f0e44ba97261000d to your computer and use it in GitHub Desktop.
Сhecking mounted resources by ip.
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 | |
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" /etc/fstab | uniq | sort > mount_on_boot | |
df -h | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | uniq | sort > already_mounted | |
DIFF=$(diff mount_on_boot already_mounted) | |
if [ "$DIFF" != "" ] | |
then | |
logger "do something" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment