Created
November 10, 2021 03:25
-
-
Save KyWa/42308a384418b99816624b6423028deb to your computer and use it in GitHub Desktop.
Bash Check Filesystem Type
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 | |
if [ -z "$1" ];then | |
echo "0 Arguments given. Please pass in a disk path" | |
echo "" | |
fi | |
fstype=`df -T | grep $1 | awk '{print $2}'` | |
if [[ $fstype == "ext4" ]];then | |
echo "do the thing" | |
else | |
echo "don't do the thing" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment