Skip to content

Commit 5443527

Browse files
Update scripts/vm/hypervisor/kvm/kvmsmpheartbeat.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4e4da44 commit 5443527

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

scripts/vm/hypervisor/kvm/kvmsmpheartbeat.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,17 @@ deleteVMs() {
115115
}
116116

117117
#checking is there the mount point present under $MountPoint?
118-
mounts=$(cat /proc/mounts | grep "$MountPoint")
119-
if [ $? -gt 0 ]
118+
if grep -q "^[^ ]\+ $MountPoint " /proc/mounts
120119
then
121-
# mount point not present — we don't remount in local-only script
122-
# nothing to do here; keep for compatibility with original flow
123-
:
124-
else
125120
# mount exists; if not in read-check mode, consider deleting VMs similar to original behavior
126121
if [ "$rflag" == "0" ]
127122
then
128123
deleteVMs $MountPoint
129124
fi
125+
else
126+
# mount point not present — we don't remount in local-only script
127+
# nothing to do here; keep for compatibility with original flow
128+
:
130129
fi
131130

132131
hbFolder="$MountPoint/KVMHA/"

0 commit comments

Comments
 (0)