From 6536ac149ee7f26fdd41ce0994ee3e6adea76899 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 25 Feb 2024 11:03:43 -0600 Subject: [PATCH] Update install-dsmon.sh --- install-dsmon.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/install-dsmon.sh b/install-dsmon.sh index c9ca111..bab2e7f 100755 --- a/install-dsmon.sh +++ b/install-dsmon.sh @@ -39,7 +39,7 @@ fi echo -e "declare -A THRESHOLD" > /opt/idssys/dsmon/config.settings.inc echo "" -DRIVEINFO=`df -BM | grep -vE '^Filesystem|tmpfs|cdrom|@|ram|loop|udev|veeamimage' | awk '{ print $1 " " $2 " " $4 }'` +DRIVEINFO=$(df -BM | grep -vE '^Filesystem|tmpfs|cdrom|@|ram|loop|udev|veeamimage|localhost|shm|overlay|-volume|Music|Software' | awk '{ print $1 " " $2 " " $4 }') DRIVEINFO=(${DRIVEINFO}) NUMDRIVES=$((${#DRIVEINFO[@]} / 3)) @@ -52,21 +52,13 @@ for ((i = 0 ; i <= $((${NUMDRIVES}-1)) ; i++)); do ia=${ia//\/dev\/mapper\//} ia=${ia//\/dev\//} - if [ "${ia}" = "sda1" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then - systempartition=true - elif [ "${ia}" = "sda14" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then - systempartition=true - elif [ "${ia}" = "sda15" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then - systempartition=true - elif [ "${ia}" = "sda2" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then + if [[ "${ia}" = *"sda"* ]] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then systempartition=true elif [ "${ia}" = "shm" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then systempartition=true - elif [ "${ia}" = "nvme0n1p1" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then + elif [[ "${ia}" = *"nvme"* ]] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then systempartition=true - elif [ "${ia}" = "nvme1n1" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 4096 ]; then - systempartition=true - elif [ "${ia}" = "mmcblk0p1" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then + elif [[ "${ia}" = *"mmcblk"* ]] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then systempartition=true elif [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then systempartition=true