Advertisement
Guest User

startup

a guest
Aug 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. if not fs.exists(".shrc") then
  2.   shrc = fs.open(".shrc","w")
  3.   shrc.write("# The contents of this file are executed \n# as Shell commands every time the System boots.\n\n# Comments can be added by starting lines with \"#\"\n\n")
  4.   shrc.flush()
  5.   shrc.close()
  6. end
  7.  
  8. shrc = fs.open(".shrc","r")
  9. while true do
  10.   cmd = shrc.readLine()
  11.   if not cmd then break end
  12.   if string.sub(cmd,1,1) ~= "#" then
  13.     shell.run(cmd)
  14.   end
  15. end
  16. shrc.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement