Put the fritzbox_port.sh
file somewhere to your Synology system.
Create a custom task entry in your Synology system options with the following code.
Update the PATH_TO_SCRIPT part and run the task as root.
bash /volume1/PATH_TO_SCRIPT/fritzbox_port.sh 1
/usr/syno/sbin/syno-letsencrypt renew-all -v
bash /volume1/PATH_TO_SCRIPT/fritzbox_port.sh 0