mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-23 03:10:30 +08:00
26 lines
606 B
CoffeeScript
26 lines
606 B
CoffeeScript
#!/usr/bin/env coffee
|
|
|
|
child_process = require 'child_process'
|
|
async = require 'async'
|
|
fs = require 'fs'
|
|
|
|
fs.readdir '/home', (err, files) ->
|
|
throw err if err
|
|
|
|
async.eachSeries files, (file, callback) ->
|
|
async.parallel [
|
|
(callback) ->
|
|
child_process.exec "sudo chown -R #{file}:#{file} /home/#{file}", (err) ->
|
|
callback err
|
|
|
|
(callback) ->
|
|
child_process.exec "sudo chmod -R o-rwx /home/#{file}", (err) ->
|
|
callback err
|
|
|
|
], (err) ->
|
|
throw err if err
|
|
console.log "finish chown/chmod for #{file}"
|
|
callback()
|
|
, ->
|
|
process.exit 0
|