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