Print message when no removable storage is detected

This commit is contained in:
ValdikSS 2021-08-16 00:43:51 +03:00
parent 35565d0ce6
commit df471fd672
1 changed files with 7 additions and 2 deletions

View File

@ -39,8 +39,13 @@ function check_iso_and_device() {
}
function list_removable_drives() {
lsblk -d -I 8 -o RM,NAME,SIZE,MODEL | \
awk '($1 == 1) {print "/dev/" substr($0, index($0, $2))}'
lsblk=$(lsblk -d -I 8 -o RM,NAME,SIZE,MODEL | \
awk '($1 == 1) {print "/dev/" substr($0, index($0, $2))}')
if [[ "$lsblk" ]]; then
echo "$lsblk"
else
echo "No removable storage found!"
fi
}
function format_drive() {