DHCP Lease-Script to Maintain DNS Cache

I’ve been looking at different scripts to keep a local DNS cache up to date based on DHCP leases. While I think this should “just work” like OpenWRT does with dnsmasq I need a solution now.

Looking at multiple options put together by the community the missing detail for me is how to best install the lease-script. It looks like if you paste it into the device over SSH you have to manually add your \r\n line breaks and escape out quotes. Is there a better way to upload a script and then target it as a file when specifying the lease-script?