#!/usr/bin/env ruby

require "libexec/load"

# Check root or not.
check_uid()

path = Path.new
Gtk.init

$flag = ""
$filename="./etc/dcast.conf"
$tmpfile="/tmp/dcast." + $$.to_s

if FileTest.exist?($tmpfile)
  puts "Error!! Exist "+ $tmpfile
  exit 1
end

$h = Hash.new
$h.store("number", 1)
$h.store("swap", 512)
$h.store("prefix", "node")
$h.store("domain", "dcast.org")
$h.store("start_slave_num", 2)
$h.store("digit", 1)

win = Gtk::Window.new
win.signal_connect("destroy") {
  Gtk::main_quit
}

if FileTest.exist?(path.tftpboot)
  allremove_gtk(win)
else
  unless FileTest.exist?($filename)
    select_eth(win)
  else
    first_select(win)
  end
end

Gtk.main
