#!/bin/bash

if [ ! -d "/opt/MegaRAID/" ]; then
  cp MegaRAID/ /opt/ -af
else
  cp MegaRAID/storcli/ /opt/MegaRAID/ -af
fi

which qemu-x86_64 > /dev/null
if [ "$?" -ne 0 ]; then
  cp qemu-x86_64 /usr/bin/
else
  qemu_ver=$(qemu-x86_64 -version | head -n 1 | awk -F " " '{print $3}')
  [[ "$qemu_ver" != "7.2.0" ]] && rm -rf /usr/bin/qemu-x86_64 && cp qemu-x86_64 /usr/bin/
fi

cp storcli64_ls /usr/bin/
