Login to your Batocera setup
Create a new folder in /userdata/system
mkdir scripts
cd scripts
Create a new file with nano and call it webrgbmatrix.sh
nano webrgbmatrix.sh
Copy the contents of the webrgbmatrix.sh in the batocera/scipts folder. Change the hostname to hostname of your webmatrix ip address or hostname.
Press Ctrl-X and press S to save and enter to confirm.
Now reboot Batocera
reboot