Browse Source

执行完后立刻清除临时文件。 #169

oldj 8 years ago
parent
commit
aacef59a4c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/server/applyAfter_Unix.js

+ 2 - 0
app/server/applyAfter_Unix.js

@@ -32,6 +32,8 @@ echo '${sudo_pswd}' | sudo -S killall -HUP mDNSResponder
   fs.writeFileSync(cmd_fn, cmd, 'utf-8');
 
   exec(`/bin/sh ${cmd_fn}`, function (error, stdout, stderr) {
+    fs.unlink(cmd_fn)
+
     // command output is in stdout
     if (error) {
       console.log(error);