This will cause network-setup.service to be restarted multiple times if you have both an IPv4 and IPv6 address. Maybe it's better to set a flag in the IPv4 and IPv6 code paths to trigger the restart at the end of the script.