storagepanel: update (test)

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-16 22:19:22 +02:00
parent bd3e87699e
commit 85a9de0c3f

View File

@ -71,14 +71,13 @@ if [ "${1}" = "-r" ]; then
exit exit
fi fi
HDD_BAY="${1}" [ -n "${1}" ] && HDD_BAY="$(echo "${HDD_BAY_LIST[@]}" | grep -iwo "${1}")" || HDD_BAY=""
if [ -n "${1}" ] && ! echo "${HDD_BAY_LIST[@]}" | grep -wq "${1}"; then if [ -n "${1}" ] && [ -z "${HDD_BAY}" ]; then
echo "storagepanel: parameter 1 error" echo "parameter 1 error"
HDD_BAY=""
fi fi
SSD_BAY="${2}" SSD_BAY="$(echo "${2^^}" | sed 's/*/X/')"
if [ -n "${2}" ] && [ -z "$(echo "${2}" | sed -n '/^[0-9]\{1,2\}X[0-9]\{1,2\}$/p')" ]; then if [ -n "${SSD_BAY}" ] && [ -z "$(echo "${SSD_BAY}" | sed -n '/^[0-9]\{1,2\}X[0-9]\{1,2\}$/p')" ]; then
echo "storagepanel: parameter 2 error" echo "storagepanel: parameter 2 error"
SSD_BAY="" SSD_BAY=""
fi fi