trogdoro / xiki

A shell console with GUI features
http://xiki.org
Other
3.76k stars 208 forks source link

Using ifconfig in xiki ip #82

Open DongDiddler opened 10 years ago

DongDiddler commented 10 years ago

Don't use ifconfig in xiki IP, it blows up on distributions that use ip instead of ifconfig.

~ # xiki ip
- tried to run:
  | args = []
  | # return "127.3.3.7"   # Hard-coded IP, for when demoing
  |
  | inet = `ifconfig`.split("\n").grep(/\binet\b/)
  |
  | return "| #{inet[0][/[\d.]+/]}" if inet.length < 2
  | inet[1][/[\d.]+/]
- error: No such file or directory - ifconfig
- backtrace:
  @/root/xiki/menu/ip.rb:3:in ``'
  @/root/xiki/menu/ip.rb:3:in `eval_inner'
  @/root/xiki/lib/xiki/core/code.rb:279:in `module_eval'
  @/root/xiki/lib/xiki/core/code.rb:279:in `eval_inner'
  @/root/xiki/lib/xiki/core/code.rb:247:in `eval'
  @/root/xiki/lib/xiki/handlers/ruby_handler.rb:33:in `handle_script'
  @/root/xiki/lib/xiki/handlers/ruby_handler.rb:18:in `handle'
  @/root/xiki/lib/xiki/core/menu.rb:1170:in `block in handle'
  @/root/xiki/lib/xiki/core/menu.rb:1167:in `each'
~ #