Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- multishell.setTitle(multishell.getCurrent(), "stop")
- local m = peripheral.find("modem")
- local senderID = os.getComputerLabel() == nil and "ID:" .. os.getComputerID() or os.getComputerLabel()
- local channels = {
- ["stdout"] = 1000,
- ["stdin"] = 1001,
- ["witherout"] = 1010,
- ["witherin"] = 1011
- }
- local receiver = ...
- local function sendCmd(program, cmd, ...)
- m.transmit(channels.stdin, channels.stdout,
- {
- ["program"] = program,
- ["type"] = "cmd",
- ["cmd"] = cmd,
- ["text"] = {...},
- ["sender"] = senderID,
- ["receiver"] = receiver
- })
- end
- print("Sending SIGTERM for 3 sec.")
- local eTime = os.clock() + 3
- while os.clock() < eTime do
- sendCmd("control", "sigterm")
- os.startTimer(0)
- os.pullEvent("timer")
- end
- shell.switchTab(1)
Add Comment
Please, Sign In to add comment