diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-07-04 20:00:33 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-07-04 20:00:33 -0300 |
commit | dd6d729d2c7aaba9d909ee3029fb87adf7ddce30 (patch) | |
tree | 89a23eafd9909dac2ab9442cf1d1b38ecf862861 | |
parent | dd9a0043dcbca800de527ce9d012050b5453de42 (diff) | |
download | bootless-dd6d729d2c7aaba9d909ee3029fb87adf7ddce30.tar.gz bootless-dd6d729d2c7aaba9d909ee3029fb87adf7ddce30.tar.bz2 |
Fix: bootless_image: check whether the device exists
-rwxr-xr-x | files/bootless | 6 |
1 files changed, 5 insertions, 1 deletions
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 |