Can't execute as superuser in volumio plugin

I’m working on a plugin that requires to enable the ip forwarding capability of linux (setting the file /proc/sys/net/ipv4/ip_forward to 1) while enabled.

So far I have a plugin with this in its index.js file:

wiredToWirelessBridge.prototype.onStart = function() {
    var self = this;
        var defer=libQ.defer();

        execSync(`sh ${__dirname}/scripts/`);

        // Once the Plugin has successfull started resolve the promise

    return defer.promise;

where scripts/ is where I execute the line

sudo echo 1 > /proc/sys/net/ipv4/ip_forward

But after enabling the plugin and checking /proc/sys/net/ipv4/ip_forward I see that it is still set to 0, meaning that that change hasn’t been applied. I tested creating some files and other operations from within the scripts/ that don’t require root permissions and they seem to work fine.

Any suggestions on how to work around this?

 execSync(`echo volumio | sudo -S ...`);