Updated uuid_fix.sh to support blkid output w/ LABELs as well as UUIDs master
Kyle Sheumaker [Tue, 25 Sep 2018 21:18:40 +0000 (16:18 -0500)]
etc/cloner3/uuid_fix.sh

index ad49bff..33614cd 100755 (executable)
@@ -13,9 +13,17 @@ blkid > /tmp/dest_uuid_map
 new_uuid_by_device() {
        DEVICE=$1
 
+       UUID=""
        RESULT=$(grep "^${DEVICE}:" ${NEW_UUID_FILE})
-       UUID=$(echo ${RESULT} | cut -d" " -f2 | sed 's/\"//g' | sed 's/^UUID=//i' )
-
+       VARS=$(echo ${RESULT} | cut -d" " -f2- | sed 's/\"//g')
+       for x in ${VARS}
+       do
+               RESULT=$(echo ${x} | grep "^UUID" 2> /dev/null)
+               if [ "$?" = "0" ]
+               then
+                       UUID=$(echo ${RESULT} | sed 's/^UUID=//i')
+               fi
+       done
        echo ${UUID}
 }