The creation and updating of Wireguard interfaces executes wg set ... twice per peer. Script also destroys/re-creates all peers on any wireguard commit.
wg set ... supports multiple peer configs (up to ARG_MAX) in a single command, arguments like allowed-ips will also override previous values so can safely be altered without needing to remove/re-add peer.
This will adjust logic causing no peer downtime on commit, only dropping public-keys removed from config.