Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- count_current=`df -hTP | grep -v Filesystem|awk '{print $1}'|wc -l`
- echo "Currently mounted filesystems count is:" $count_current
- count_fstab=`cat /etc/fstab | grep -v '#'|awk '{print $1}'|wc -l`
- echo "Total number of filesystems are:" $count_fstab
- readonly differ=$(( count_current - count_fstab ))
- if (( differ -eq $((count_current - count_fstab)) ))
- then
- echo "All filesystems are mounted correctly"
- else
- echo "checking on it"
- fi
- [root@host ~]# ./script
- Currently mounted filesystems count is: 10
- Total number of filesystems are: 15
- All filesystems are mounted correctly
- [root@host ~]# umount /var/crash
- [root@host ~]# ./script
- Currently mounted filesystems count is: 9
- Total number of filesystems are: 15
- All filesystems are mounted correctly
- [root@host ~]#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement