From: Silvio Rhatto Date: Thu, 4 Jul 2024 23:00:33 +0000 (-0300) Subject: Fix: bootless_image: check whether the device exists X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=dd6d729d2c7aaba9d909ee3029fb87adf7ddce30;p=bootless.git Fix: bootless_image: check whether the device exists --- diff --git a/files/bootless b/files/bootless index 0dffd6c..60c649e 100755 --- a/files/bootless +++ b/files/bootless @@ -173,8 +173,12 @@ function bootless_image { if [ "$?" != "0" ]; then echo "Skipping copy of ${output} to ${device}..." else + # Check if device exists + if [ ! -e "${device}" ]; then + echo "Error: device \"${device}\" does not exist." + echo "Skipping copy of ${output} to ${device}..." # Check if device is mounted - if [ "`mount | grep ${device}`" != "" ]; then + elif [ "`mount | grep ${device}`" != "" ]; then echo "Error: device \"${device}\" is mounted." echo "Skipping copy of ${output} to ${device}..." else