mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-25 15:10:38 +01:00
better to parse raid candidates info
This commit is contained in:
parent
cbe6148650
commit
23aa6b2c8b
1 changed files with 8 additions and 1 deletions
|
@ -183,7 +183,10 @@ if [ "$1" = "status" ]; then
|
||||||
devMounted=$(lsblk -o MOUNTPOINT,NAME | grep "$disk" | grep -c "^/")
|
devMounted=$(lsblk -o MOUNTPOINT,NAME | grep "$disk" | grep -c "^/")
|
||||||
# is raid candidate when not mounted and not the data drive cadidate (hdd/ssd)
|
# is raid candidate when not mounted and not the data drive cadidate (hdd/ssd)
|
||||||
if [ ${devMounted} -eq 0 ] && [ "${disk}" != "${hdd}" ]; then
|
if [ ${devMounted} -eq 0 ] && [ "${disk}" != "${hdd}" ]; then
|
||||||
mountoption=$(lsblk -o NAME,SIZE,VENDOR | grep "^$disk" | awk '$1=$1')
|
sizeBytes=$(lsblk -o NAME,SIZE -b | grep "^${disk}" | awk '$1=$1' | cut -d " " -f 2)
|
||||||
|
sizeGigaBytes=$(echo "scale=0; ${sizeBytes}/1024/1024/1024" | bc -l)
|
||||||
|
vedorname=$(lsblk -o NAME,VENDOR | grep "^sda" | awk '$1=$1' | cut -d " " -f 2)
|
||||||
|
mountoption="${disk} ${sizeGigaBytes} GB ${vedorname}"
|
||||||
echo "raidCandidate[${drivecounter}]='${mountoption}'"
|
echo "raidCandidate[${drivecounter}]='${mountoption}'"
|
||||||
drivecounter=$(($drivecounter +1))
|
drivecounter=$(($drivecounter +1))
|
||||||
fi
|
fi
|
||||||
|
@ -192,6 +195,10 @@ if [ "$1" = "status" ]; then
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
size=
|
||||||
|
echo "hddBytes=${size}"
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "# SWAP"
|
echo "# SWAP"
|
||||||
|
|
Loading…
Add table
Reference in a new issue