Luci.sys.exec issue

Hello,
Please forgive my ignorance. I am trying to execute a system command. The first line of the code below works fine (it shows a notification message), however, the second line fails to create a text file. Any help is appreciated.

ui.addNotification(null, E('p', _('file was created.')), 'info');
 luci.sys.exec("touch /www/test.txt");

The solution was :
fs.exec('/bin/touch', ['/www/test.txt']);

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.