Follow block device symlinks
This commit is contained in:
parent
7ea2454c70
commit
df45e39d42
@ -20,7 +20,9 @@ function usage () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function disk_check () {
|
function disk_check () {
|
||||||
DISK_TYPE=$(file "$1" | awk '{ print $2$3 }')
|
DISK="$1"
|
||||||
|
[ -L "$DISK" ] && DISK=$(readlink -f "$DISK")
|
||||||
|
DISK_TYPE=$(file "$DISK" | awk '{ print $2$3 }')
|
||||||
if [ "$DISK_TYPE" != "blockspecial" ]; then
|
if [ "$DISK_TYPE" != "blockspecial" ]; then
|
||||||
echo "ERROR: Disk '$1' is not a block device"
|
echo "ERROR: Disk '$1' is not a block device"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user