From 50b6588d6350c7b15ffbcf5e0e704461861a8870 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 25 May 2015 15:57:19 -0400 Subject: check_block(): New function --- 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})" -- cgit v0.9.1