fix: detecting version files

This commit is contained in:
Peter Šurda 2021-03-02 23:54:35 +01:00
parent a4a3250aa7
commit 22d48e13bc
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -31,7 +31,7 @@ function update_syslinux_menu()
versions["$version"]=1
missing=""
for f in "${files[@]}"; do
if [ ! -e "$mnt"/"$imagepath"/"$f""$version" ]; then
if [ ! -e "$mnt""$imagepath"/"$f""$version" ]; then
missing="1"
fi
done
@ -49,8 +49,8 @@ _EOL_
# find expired
for f in "${files[@]}"; do
for i in "$mnt"/"$imagepath"/"$f"*; do
version="$(basename "$i"|cut -d_ -f2-)"
for i in "$mnt""$imagepath"/"$f"*; do
version="$(basename "$i"|cut -d. -f2-)"
if [ -z "${versions[$version]}" ]; then
rm -f $i
fi