mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 04:57:55 +00:00
mount-usb: suppress error output from calls to stat
If no USB storage devices inserted, stat will output unnecessary error text to console Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
parent
a2d50a10f7
commit
8d6f47fb4d
@ -21,7 +21,7 @@ if [ ! -d /media ]; then
|
||||
mkdir /media
|
||||
fi
|
||||
|
||||
stat -c %N /sys/block/sd* | grep usb | cut -f1 -d ' ' | sed "s/[']//g;s|/sys/block|/dev|" > /tmp/usb_block_devices
|
||||
stat -c %N /sys/block/sd* 2>/dev/null | grep usb | cut -f1 -d ' ' | sed "s/[']//g;s|/sys/block|/dev|" > /tmp/usb_block_devices
|
||||
if [ -z `cat /tmp/usb_block_devices` ]; then
|
||||
if [ -x /bin/whiptail ]; then
|
||||
whiptail --title 'USB Drive Missing' \
|
||||
@ -31,7 +31,7 @@ if [ -z `cat /tmp/usb_block_devices` ]; then
|
||||
read
|
||||
fi
|
||||
sleep 1
|
||||
stat -c %N /sys/block/sd* | grep usb | cut -f1 -d ' ' | sed "s/[']//g;s|/sys/block|/dev|" > /tmp/usb_block_devices
|
||||
stat -c %N /sys/block/sd* 2>/dev/null | grep usb | cut -f1 -d ' ' | sed "s/[']//g;s|/sys/block|/dev|" > /tmp/usb_block_devices
|
||||
if [ -z `cat /tmp/usb_block_devices` ]; then
|
||||
if [ -x /bin/whiptail ]; then
|
||||
whiptail $CONFIG_ERROR_BG_COLOR --title 'ERROR: USB Drive Missing' \
|
||||
|
Loading…
Reference in New Issue
Block a user