Advertisement
tm512

Odasrv Wrapper (ruby)

Oct 20th, 2011
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.01 KB | None | 0 0
  1. #!/usr/bin/ruby
  2.  
  3. # servers template [cfg, additional cmdline params]
  4.  
  5. servers = Array[
  6. ["crudream"],
  7. ["gw2"],
  8. ["danzig"],
  9. ["32in24-5"],
  10. ["udm1"],
  11. ["udmx"],
  12. ["dwango12"],
  13. ["ksutra", "-file ksutra.wad"],
  14. ["requiem", "-file requiem.wad"],
  15. ["pl2", "-iwad plutonia.wad -file pl2.wad"],
  16. ["wos", "-file wos.wad"],
  17. ["duel1"],
  18. ["duel2"]
  19. ]
  20.  
  21. # file paths (use trailing slashes!)
  22. cfgpath="/home/tm512/cfgs/"
  23. wadpath="/home/tm512/iwads/:/home/tm512/pwads/"
  24. logpath="/home/tm512/logs/"
  25.  
  26. puts "Using " + wadpath + " as the WAD directory/directories."
  27. puts ARGV[0]
  28. system "export DOOMWADPATH=" + wadpath
  29.  
  30. for i in servers
  31.     next if ARGV[0] != i[0] and ARGV[0] != nil
  32.     if i[1] != nil
  33.         cmd = "odasrv -config " + cfgpath + i[0] + ".cfg +logfile " + logpath + i[0] + ".log " + i[1] + " -background 1 > /dev/null &"
  34.         puts "==> " + cmd
  35.         system cmd
  36.     else
  37.         cmd = "odasrv -config " + cfgpath + i[0] + ".cfg +logfile " + logpath + i[0] + ".log -background 1 > /dev/null &"
  38.         puts "==> " + cmd
  39.         system cmd
  40.     end
  41. end
  42.  
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement