mirror of
https://github.com/byReqz/stocheck.git
synced 2024-11-22 14:41:15 +00:00
tweak formatting
This commit is contained in:
parent
77f856c529
commit
60f6cc7fd5
11
stocheck.sh
11
stocheck.sh
@ -31,7 +31,7 @@ while [ -z "$1" ]; do
|
|||||||
echo -e "--------------------------------------------------"
|
echo -e "--------------------------------------------------"
|
||||||
for ((x=1;x<=raidlist2;x++)); do
|
for ((x=1;x<=raidlist2;x++)); do
|
||||||
raid=$(echo "$raidlist" | sed -n "$x"p)
|
raid=$(echo "$raidlist" | sed -n "$x"p)
|
||||||
if [[ -z $(echo "$lsbl" | grep -e "$raid" | grep -e "%") ]];then
|
if [[ -z $(echo "$lsbl" | grep -e "%") ]];then
|
||||||
raidts="unmounted"
|
raidts="unmounted"
|
||||||
fi
|
fi
|
||||||
if [[ "$raidts" == "unmounted" ]];then
|
if [[ "$raidts" == "unmounted" ]];then
|
||||||
@ -39,11 +39,9 @@ while [ -z "$1" ]; do
|
|||||||
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 4)
|
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 4)
|
||||||
raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4)
|
raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4)
|
||||||
raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ")
|
raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ")
|
||||||
raidts="$(sfdisk -l | grep -e "$raid:" | cut -d " " -f 3) GiB"
|
echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mFS:\033[0m "$raidfs""
|
||||||
echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mSize:\033[0m "$raidts""
|
|
||||||
echo -e "\033[1mMembers:\033[0m "$raiddrives""
|
echo -e "\033[1mMembers:\033[0m "$raiddrives""
|
||||||
echo -e "\033[1mState:\033[0m "unmounted" \033[1mFilesystem:\033[0m "$raidfs""
|
echo -e "\033[1mState:\033[0m "$raidts" \033[1mP-UUID\033[0m "$raiduuid""
|
||||||
echo -e "\033[1mP-UUID\033[0m "$raiduuid""
|
|
||||||
echo -e ""
|
echo -e ""
|
||||||
else
|
else
|
||||||
raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3)
|
raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3)
|
||||||
@ -52,8 +50,7 @@ while [ -z "$1" ]; do
|
|||||||
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 4)
|
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 4)
|
||||||
raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4)
|
raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4)
|
||||||
raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ")
|
raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ")
|
||||||
raidts="$(sfdisk -l | grep -e "$raid:" | cut -d " " -f 3) GiB"
|
echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mSize:\033[0m "$raidts" \033[1m%:\033[0m "$raidper""
|
||||||
echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mSize:\033[0m "$raidts"/"$raidper""
|
|
||||||
echo -e "\033[1mMembers:\033[0m "$raiddrives""
|
echo -e "\033[1mMembers:\033[0m "$raiddrives""
|
||||||
echo -e "\033[1mState:\033[0m "mounted" \033[1mFilesystem:\033[0m "$raidfs" \033[1mMountpoint:\033[0m "$raidmp""
|
echo -e "\033[1mState:\033[0m "mounted" \033[1mFilesystem:\033[0m "$raidfs" \033[1mMountpoint:\033[0m "$raidmp""
|
||||||
echo -e "\033[1mP-UUID\033[0m "$raiduuid""
|
echo -e "\033[1mP-UUID\033[0m "$raiduuid""
|
||||||
|
Loading…
Reference in New Issue
Block a user