Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. STATUS = 4
  2.  
  3. puts STATUS
  4. lines = File.readlines(__FILE__)
  5. lines[0] = "STATUS = #{(STATUS+1)%5}\n"
  6. File.write(__FILE__, lines.join)
  7.  
  8. if (ARGV[0] == "OFF" and STATUS == 0) or (ARGV[0] == "ON" and STATUS == 4) or ARGV[0] == nil
  9. exit
  10. else
  11. system("ruby #{__FILE__} #{ARGV[0]}")
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement