diff options
-rw-r--r-- | lib/block.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/block.sh b/lib/block.sh index 3911c3a..d83572e 100644 --- a/lib/block.sh +++ b/lib/block.sh @@ -32,14 +32,21 @@ is_block() return ${?} } -block_mount() +check_block() { local dev="${1}" - local dir= if ! [ -b "${dev}" ]; then error 2 "$(get_msg 'block_device_invalid')" fi +} + +block_mount() +{ + local dev="${1}" + local dir= + + check_block "${dev}" rand dir="$(get_vardata_dir 'mount')/block-$(printf '%010d' ${rand_x})" |