aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfiles/bootless6
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