If macipgw is already running, that script might not run as it should. Type sudo systemctl stop macipgw before trying to run the script. The script itself requires root privileges, so add an sudo in front of it.
It may also not be picking up your default network interface. Replace $atalkd_if...