Run script from nc-config (or ncp-config) from script and without gui

Nextcloud version 15.0.5
Operating system and version Nextcloudpi v1.14.3
PHP version PHP 7.2.20

I face an issue where nc-foward-ports becomes “undone” (probably an issue outside of nextcloud), and I have to rerun the script. In order to automate this fix, how can I run nc-forward-ports from a script? I’ve tried some basic things from the terminal and I can’t find anything online on how to do it.

Thanks!