kewlhotrod

Untitled

Jul 1st, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. var sys = require('sys')
  2. var exec = require('child_process').exec;
  3. var path = Math.floor(Math.random()*101)
  4.  
  5. var fs = require('fs');
  6. fs.readFile('/home/shoutcast/mkdir.sh', function (err, data) {
  7. if (err)
  8. throw err;
  9. if (data)
  10. console.log(data.toString('utf8'));
  11. var result = data.replace(NEWDIR=TEST, 'NEWDIR=YES');
  12. }
  13.  
  14.  
  15. fs.writeFile(data, result, function (err) {
  16. if (err) return console.log(err);}
  17. );
  18.  
  19. function puts(error, stdout, stderr) { sys.puts(stdout) }
  20. exec("bash /home/shoutcast/mkdir.sh", puts);
  21.  
  22.  
  23.  
  24.  
  25. fs.writeFile(data, result, function (err) {
  26. ^^
  27. SyntaxError: Unexpected identifier
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. Trying to write the replacement. I tested this script out with just reading and it functioned fine. (Up to first closing bracket)
Advertisement
Add Comment
Please, Sign In to add comment