-# now copy the puppet changed interfaces to /etc/network/interfaces
-do_mv /var/run/interfaces.puppet /etc/network/interfaces
-
-# now restart networking service
-/etc/init.d/networking restart
+# check if this is a duplicated configuration
+if ! diff -I '^#' "/var/run/interfaces.puppet" "/etc/network/interfaces" > /dev/null; then
+ # now copy the puppet changed interfaces to /etc/network/interfaces
+ do_mv /var/run/interfaces.puppet /etc/network/interfaces
+
+ # now restart networking service
+ /etc/init.d/networking restart
+
+ sleep 5
+else
+ # need to remove this file also
+ do_rm /var/run/interfaces.puppet
+fi