mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-23 19:21:04 +08:00
ssh kill
This commit is contained in:
@@ -14,3 +14,13 @@ Exception:
|
||||
|
||||
* invalid_password
|
||||
* not_in_service
|
||||
|
||||
### POST /plugin/ssh/kill
|
||||
|
||||
Request:
|
||||
|
||||
{
|
||||
"pid": 1234
|
||||
}
|
||||
|
||||
No Response.
|
||||
|
||||
@@ -22,3 +22,9 @@ exports.post '/update_password', (req, res) ->
|
||||
child_process.exec "echo '#{req.account.username}:#{req.body.password}' | sudo chpassword", (err, stdout, stderr) ->
|
||||
throw err if err
|
||||
res.json {}
|
||||
|
||||
exports.post '/kill', (req, res) ->
|
||||
pid = parseInt req.body.pid
|
||||
child_process.exec "sudo su #{req.account.username} -c 'kill #{pid}}'", (err, stdout, stderr) ->
|
||||
throw err if err
|
||||
res.json {}
|
||||
|
||||
Reference in New Issue
Block a user