Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #208 // BASH access test

Lua code

assert(bash_start, "Sorry: Need privileges. (e.g.: run -power 208)")

bash_start()
bash_send('date\n')
--bash_send('date\n')
bash_send('exit\n')

for i=1, 10 do
  os_sleep(500)
  local alive = bash_alive()
  out, err = unpack(bash_poll())
    
  -- print err first so bash output looks prettier.
  if err ~= '' then print(err) end
  if out ~= '' then print(out) end
  if not alive then break end
end

if bash_alive() then bash_kill() end
return 'ok'

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

2 comment(s) hidden. show

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 468 [visualize]

Snippet ID: #208
Snippet name: BASH access test
Eternal ID of this version: #208/1
Text MD5: b2af831c8d62b2a384cf08d59cb0dc19
Author: stefan
Category:
Type: Lua code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-01-25 16:13:39
Source code size: 468 bytes / 20 lines
Pitched / IR pitched: Yes / Yes
Views / Downloads: 1599 / 285
Referenced in: [show references]