mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-03 20:48:46 +02:00
Update 00-local_mounts.sh
This commit is contained in:
@@ -33,20 +33,21 @@ if bashio::config.has_value 'localdisks'; then
|
|||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
for disk in ${MOREDISKS//,/ }; do
|
for disk in ${MOREDISKS//,/ }; do
|
||||||
|
|
||||||
# Mount as uuid if length of name is 36 characters
|
# Remove text until last slash
|
||||||
if [ -e /dev/"${disk}" ] ; then
|
disk="${disk##*/}"
|
||||||
echo "... mount as uuid"
|
|
||||||
devpath=/dev/disk/by-uuid
|
# Function to check what is the type of device
|
||||||
# Mount as label if not found in /dev
|
if lsblk | grep -q "^$1"; then
|
||||||
elif [ -n "$(lsblk -o LABEL | grep -w "NAS" | awk '{print $1}')" ]; then
|
echo "... $disk is a physical device."
|
||||||
echo "... mount as label"
|
|
||||||
devpath=/dev/disk/by-label
|
|
||||||
elif [ -e /dev/"${disk}" ]; then
|
|
||||||
echo "... mount as physical device"
|
|
||||||
devpath=/dev
|
devpath=/dev
|
||||||
else
|
elif lsblk -o UUID | grep -q "$1"; then
|
||||||
bashio::log.fatal "... $disk was found neither in uuid, labels or physical drives, it will be skipped"
|
echo "... $disk is a device by UUID."
|
||||||
continue
|
devpath=/dev/disk/by-uuid
|
||||||
|
elif lsblk -o LABEL | grep -q "$1"; then
|
||||||
|
echo "... $disk is a device by label."
|
||||||
|
devpath=/dev/disk/by-label
|
||||||
|
else
|
||||||
|
echo "$disk does not match any known physical device, UUID, or label."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Creates dir
|
# Creates dir
|
||||||
|
|||||||
Reference in New Issue
Block a user