mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
29 lines
624 B
Bash
29 lines
624 B
Bash
|
#!/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[@]}"
|