fix logic when updating modtimes

This commit is contained in:
Simon Marsh 2024-09-07 17:05:24 +01:00
parent 87cb850050
commit b2f88566d2
Signed by: burble
GPG Key ID: E9B4156C1659C079

View File

@ -57,7 +57,6 @@ declare -A interfaces
declare -A previous_modtimes
declare -A add_interfaces
declare -A remove_interfaces
modcount=0
if [ -f "$MODFILE" ]
then
@ -87,8 +86,6 @@ do
# if an interface has been modified, remove it then re-add it
remove_interfaces[$iface]=1
add_interfaces[$iface]=1
modcount=$(( modcount + 1 ))
done
###########################################################################
@ -147,7 +144,8 @@ done
# all done
# save the modified times if required
if [ "$modcount" -gt 0 ]
if [ "${#add_interfaces[@]}" -gt 0 ] ||
[ "${#remove_interfaces[@]}" -gt 0 ]
then
exec 3> "$MODFILE"
for file in "${!modtimes[@]}"