Fix scripts to safeguard agent from spurious add/deletes

Signed-off-by: Anirban Chakraborty <abchak@juniper.net>