diff --git a/luci-app-zapret2/htdocs/luci-static/resources/view/zapret2/tools.js b/luci-app-zapret2/htdocs/luci-static/resources/view/zapret2/tools.js index 7d34b1a..1c8d3de 100644 --- a/luci-app-zapret2/htdocs/luci-static/resources/view/zapret2/tools.js +++ b/luci-app-zapret2/htdocs/luci-static/resources/view/zapret2/tools.js @@ -329,7 +329,8 @@ return baseclass.extend({ aux: '', rows: 10, callback: null, - file_exists: false + file_exists: false, + setperm: 644, }, opts); }, @@ -390,6 +391,12 @@ return baseclass.extend({ throw new Error('tee failed, rc = ' + res.code); } } + if (this.setperm) { + let res = await fs.exec('/bin/busybox', [ 'chmod', '' + this.setperm, tmpFile ]); + if (res.code != 0) { + throw new Error('chmod failed, rc = ' + res.code); + } + } let res = await fs.exec('/bin/busybox', [ 'mv', '-f', tmpFile, fileName ]); if (res.code != 0) { throw new Error('mv failed, rc = ' + res.code);