From 2e75681f83837f236eade9650f652471a507b973 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 16 Sep 2010 21:31:23 +0000 Subject: [PATCH] optimized a bit to reduce fs checks --- inxi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 1b5181d..93e3c5a 100755 --- a/inxi +++ b/inxi @@ -3322,14 +3322,18 @@ get_partition_uuid_label_data() # only run these tests once per directory to avoid excessive queries to fs case $1 in label) - if [[ -d /dev/disk/by-label && $B_LABEL_SET != 'true' ]];then - DEV_DISK_LABEL="$( ls -l /dev/disk/by-label )" + if [[ $B_LABEL_SET != 'true' ]];then + if [[ -d /dev/disk/by-label ]];then + DEV_DISK_LABEL="$( ls -l /dev/disk/by-label )" + fi B_LABEL_SET='true' fi ;; uuid) - if [[ -d /dev/disk/by-uuid && $B_UUID_SET != 'true' ]];then - DEV_DISK_UUID="$( ls -l /dev/disk/by-uuid )" + if [[ $B_UUID_SET != 'true' ]];then + if [[ -d /dev/disk/by-uuid ]];then + DEV_DISK_UUID="$( ls -l /dev/disk/by-uuid )" + fi B_UUID_SET='true' fi ;;