grub-pxelinux_config: use shell features for directory browsing
authorMichael Prokop <mika@grml.org>
Fri, 28 Mar 2014 09:18:04 +0000 (10:18 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 28 Mar 2014 09:18:04 +0000 (10:18 +0100)
templates/grub-pxelinux_config

index 694293e..ba1f2f4 100644 (file)
@@ -94,9 +94,10 @@ fi
 # Copy initrd.img and vmlinuz from all directories which name begins
 # with grml, e.g. grml32full and grml64full
 # This way we can boot multiple ISOs
-for filename in $(ls -d ${MULTIBOOT_PATH_}/grml*); do
-  cp -r ${filename} ${TFTPD_DATA_DIR_}/boot/
-done 
+for filename in "${MULTIBOOT_PATH_}"/grml* ; do
+  [ -d "$filename" ] || continue
+  cp -r "${filename}" "${TFTPD_DATA_DIR_}/boot/"
+done
 
 config_files_=$(find "$TFTPD_DATA_DIR_/" -name "*.cfg" -type f)