kewlhotrod

Untitled

Jul 1st, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 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. return console.log(err);
  9. }
  10. console.log(data.toString());
  11. var result = data.toString().replace('NEWDIR="TEST"', 'NEWDIR="YES"');
  12.  
  13. fs.writeFile('/home/shoutcast/mkdir.sh', result, function (err) {
  14. if (err) return console.log(err);
  15. });
  16. });
  17.  
  18. function puts(error, stdout, stderr) { sys.puts(stdout) }
  19. exec("bash /home/shoutcast/mkdir.sh", puts);
Advertisement
Add Comment
Please, Sign In to add comment