fix logic when updating modtimes
This commit is contained in:
parent
87cb850050
commit
b2f88566d2
@ -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[@]}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user