This script enables USB On-The-Go (OTG) functionality on a Raspberry Pi (currently tested and working up to Raspbian Bullseye). USB OTG enables the device to be plugged into a USB port, powered and directly accessed over IP from a host computer without any other network access.
The script and code are based on an original blog post by Ben Hardill. There is some additional code to enable systemd functionality from the pre-built image scripts developed by Tech Craft.
I created this script primarily for my own use, but if you found it helpful, you’re welcome ツ.