mirror of
https://github.com/bin456789/reinstall.git
synced 2025-12-10 07:28:56 +08:00
不重要的优化
This commit is contained in:
11
get-xda.sh
11
get-xda.sh
@ -3,15 +3,8 @@
|
||||
# alpine 未用到此脚本
|
||||
|
||||
get_all_disks() {
|
||||
# busybox blkid 不接受任何参数
|
||||
disks=$(blkid | cut -d: -f1 | cut -d/ -f3 | sed -E 's/p?[0-9]+$//' | sort -u)
|
||||
# blkid 会显示 sr0,经过上面的命令输出为 sr
|
||||
# 因此要检测是否有效
|
||||
for disk in $disks; do
|
||||
if [ -b "/dev/$disk" ]; then
|
||||
echo "$disk"
|
||||
fi
|
||||
done
|
||||
# shellcheck disable=SC2010
|
||||
ls /sys/block/ | grep -Ev '^(loop|sr|nbd)'
|
||||
}
|
||||
|
||||
get_xda() {
|
||||
|
||||
Reference in New Issue
Block a user