From dd6d729d2c7aaba9d909ee3029fb87adf7ddce30 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 4 Jul 2024 20:00:33 -0300 Subject: Fix: bootless_image: check whether the device exists --- files/bootless | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3