Ignore unsupported labes and always use ID_FS_LABEL if valid
[grml-udev-config.git] / scripts / grml-udev-rebuildfstab
index 9181b74..5b588d5 100755 (executable)
@@ -138,7 +138,11 @@ iso9660)
 break;
 ;;
 *)
-[ -n "$LABEL" ]  && [ -n "$ID_FS_LABEL" ] && echo "LABEL=$ID_FS_LABEL_ENC"  && return
+if [ -n "$LABEL" ]  && [ -n "$ID_FS_LABEL" ] ; then
+  case $ID_FS_LABEL in *\ *|*\x20*) break ;; esac
+  echo "LABEL=$ID_FS_LABEL"
+  return
+fi
 ;;
 esac
 [ -n "$DM_NAME" ] && echo /dev/mapper/$DM_NAME && return
@@ -208,7 +212,7 @@ mountpoint=$(get_mount_point $device)
 
 for devicelink in $DEVLINKS ; do
     # ignore external
-    case "$devicelink" in "*external*") continue ;; esac
+    case "$devicelink" in *external*) continue ;; esac
     stringinfile $devicelink $TMPFILE && bailout 0
 done