mount-usb: Fix word splitting in test for USB devices

For partitioned media or when more than one device is present, this
fixes a benign script error that ash had apparently ignored.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
Jonathon Hall 2023-03-25 17:06:12 -04:00
parent e32fc91baf
commit f1708bf3a7
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114

View File

@ -23,7 +23,7 @@ if [ ! -d /media ]; then
fi
list_usb_storage > /tmp/usb_block_devices
if [ -z `cat /tmp/usb_block_devices` ]; then
if [ -z "$(cat /tmp/usb_block_devices)" ]; then
if [ -x /bin/whiptail ]; then
whiptail $BG_COLOR --title 'USB Drive Missing' \
--msgbox "Insert your USB drive and press Enter to continue." 16 60
@ -33,7 +33,7 @@ if [ -z `cat /tmp/usb_block_devices` ]; then
fi
sleep 1
list_usb_storage > /tmp/usb_block_devices
if [ -z `cat /tmp/usb_block_devices` ]; then
if [ -z "$(cat /tmp/usb_block_devices)" ]; then
if [ -x /bin/whiptail ]; then
whiptail $BG_COLOR_ERROR --title 'ERROR: USB Drive Missing' \
--msgbox "USB Drive Missing! Aborting mount attempt.\n\nPress Enter to continue." 16 60