This guide explains how to Create a Provisioning Script and also how to use it for that.
The execution of the script is used to authorize and provision a onu in made4olt
In the side menu, go to Settings → Provisioning Scripts.

Click on Add

Select the olt that will run the Script, name it, and paste the Script content

It is possible to use variables already created or also create new ones for the Script
config
interface gpon #BOARD/#SLOT
ont add #PORT #ONT_ID sn-auth #SERIAL_NUMBER omci ont-lineprofile-id #LINE_PROFILE ont-srvprofile-id #SERVICE_PROFILE desc #DESC
ont ipconfig #PORT #ONT_ID pppoe vlan #VLAN priority 5 user-account username #PPPOE_USER password #PPPOE_PASS
quit
service-port vlan #VLAN gpon #BOARD/#SLOT/#PORT ont #ONT_ID gemport #VLAN multi-service user-vlan #VLAN tag-transform #TAG_TRANSFORM_MODE
quit
It is necessary to adapt the reality of the settings used in your network if you use the example script
Go to Unprovisioned ONUs > Authorize.

Select Script-based Provisioning

Fill in the available fields, where Name, Description, and Mode of onu are mandatory, and then click the Next button

Select the desired script and fill in the variables

Review how the script turned out and then click on Run script

The script will run displaying the output of the commands and then finish to complete the provisioning of the onu.