fix: array iteration
This commit is contained in:
parent
51b53bd19a
commit
95f85da5b4
|
@ -24,22 +24,22 @@ function update_syslinux_menu()
|
|||
for part in $partitions; do
|
||||
version_from_partnum "$drive" "$part"
|
||||
versions["$version"]=1
|
||||
for f in $files; do
|
||||
for f in "${files[@]}"; do
|
||||
if [ ! -e "$mnt"/"$imagepath"/"$f""$version" ]; then
|
||||
continue
|
||||
fi
|
||||
done
|
||||
cat >> "$mnt"/items.cfg << (EOL)
|
||||
cat >> "$mnt"/items.cfg << _EOL_
|
||||
|
||||
LABEL cloud-init-$version
|
||||
MENU LABEL Ubuntu focal (MAAS $version)
|
||||
KERNEL $imagepath/boot-kernel.$version
|
||||
APPEND initrd=$imagepath/boot-initrd.$version root=PARTLABEL="rootfs_$version" ip=dhcp overlayroot=tmpfs:recurse=0 ds=nocloud-net;s=https://box.sysdeploy.org/cloud-init/
|
||||
(EOL)
|
||||
_EOL_
|
||||
done
|
||||
|
||||
# find expired
|
||||
for f in $files; do
|
||||
for f in "${files[@]}"; do
|
||||
for i in "$mnt"/"$imagepath"/"$f"*; do
|
||||
version="$(basename "$i"|cut -d_ -f2-)"
|
||||
if [ -z "${versions[$version]}" ]; then
|
||||
|
|
Loading…
Reference in New Issue
Block a user