mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
0c9b4f1d9b
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
29 lines
624 B
Bash
Executable File
29 lines
624 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
|
#
|
|
# This is free software, licensed under the MIT License.
|
|
# See /LICENSE for more information.
|
|
#
|
|
|
|
args=()
|
|
|
|
HBA=false
|
|
for argv in "$@"; do
|
|
if [ -e "${argv}" ] && readlink -f "/sys/block/$(basename "${argv}")/device" 2>/dev/null | grep -q "expander"; then
|
|
HBA=true
|
|
fi
|
|
done
|
|
|
|
argp=""
|
|
for argv in "$@"; do
|
|
if [ "${argp}" = "-d" ] && [ "${argv}" = "ata" ] && [ "${HBA}" = "true" ]; then
|
|
args+=("sat")
|
|
else
|
|
args+=("${argv}")
|
|
fi
|
|
argp="${argv}"
|
|
done
|
|
|
|
/usr/bin/smartctl.bak "${args[@]}"
|