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Nʧml d{q<! |DUF+N㓌OcHD\!$Ǣ/>y\ :/]/eJa'H"J1NG`AP>!@A]1DƂEOQ"Җhh&&,_<҇Q<9I\ +D@ lF2>@>AB'ǐG/˙DD (Y|ʄ4#DK0 Ż#q')F [Ĩ# |=R(mF=f&\o9siehbN8ݢ؟9p$EBw9@E[<.KS l`4gD66.u-/?/ck1]oǕi3=gY>ڶ^j:ź+EoQ :#6ͳܣ}Sq(>>Pl[; @ @ @ @  @ @ @ @@ @ @ 67"IENDB`xnetcardconfig-0.3.0/Makefile0000644002342000234200000000467212452220047014367 0ustar rzrrzr#!/usr/bin/env make # # file: Makefile # # Copyright (c) 2004 os-cillation # All rights reserved. # # Written by Benedikt Meurer . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # package?=xnetcardconfig DESTDIR?=/usr/local/opt/${package} prefix=/usr INSTALL_DIR= install -d -o root -m 0755 INSTALL_DATA= install -c -o root -m 0644 INSTALL_SCRIPT= install -c -o root -m 0755 VERSION?=0.0.$(shell date -u +%Y%m%d) PACKAGE=xnetcardconfig all: xnetcardconfig xnetcardconfig.real install: all $(INSTALL_DIR) $(DESTDIR)$(prefix)/bin $(INSTALL_DIR) $(DESTDIR)$(prefix)/share/applications $(INSTALL_DIR) $(DESTDIR)$(prefix)/share/apps/xnetcardconfig $(INSTALL_DIR) $(DESTDIR)$(prefix)/share/pixmaps $(INSTALL_SCRIPT) xnetcardconfig $(DESTDIR)$(prefix)/bin/xnetcardconfig $(INSTALL_SCRIPT) xnetcardconfig.real $(DESTDIR)$(prefix)/bin/xnetcardconfig.real $(INSTALL_DATA) card.png $(DESTDIR)$(prefix)/share/pixmaps/xnetcardconfig.png $(INSTALL_DATA) card.png $(DESTDIR)$(prefix)/share/apps/xnetcardconfig/card.png $(INSTALL_DATA) logo.png $(DESTDIR)$(prefix)/share/apps/xnetcardconfig/logo.png $(INSTALL_DATA) xnetcardconfig.desktop $(DESTDIR)$(prefix)/share/applications/xfld-xnetcardconfig.desktop clean: @rm -f xnetcardconfig xnetcardconfig.real *~ */*~ dist: rule/tarball distclean: clean xnetcardconfig: xnetcardconfig.in sed -e s,@PREFIX@,$(prefix),g < $< > $@ chmod 0755 $@ xnetcardconfig.real: xnetcardconfig.real.in sed -e s,@PREFIX@,$(prefix),g < $< > $@ chmod 0755 $@ rule/tarball: clean [ ! -r ../${PACKAGE}-${VERSION} ] || exit 1 cd .. && ln -s $(shell basename ${CURDIR}) ${PACKAGE}-${VERSION} cd .. && tar cfzvh ${PACKAGE}-${VERSION}.tar.gz \ --exclude-vcs \ --exclude "debian" \ --exclude "CVS" --exclude ".bzr" --exclude '.git' \ --exclude "*~" \ ${PACKAGE}-${VERSION}/ #eof xnetcardconfig-0.3.0/README0000644002342000234200000000043112452220047013574 0ustar rzrrzrProject: xnetcardconfig URL: https://launchpad.net/xnetcardconfig License: GPL-2 Description: Tool to configure your network cards using a wizard GUI Upstream Author: Benedikt Meurer Maintainer: Philippe Coval Programming Lang: Ruby xnetcardconfig-0.3.0/xnetcardconfig.desktop0000644002342000234200000000222012452220047017303 0ustar rzrrzr# $Id: xnetcardconfig.desktop,v 1.1.1.1 2004-08-09 20:40:34 bmeurer Exp $ # # Copyright (c) 2004 os-cillation # All rights reserved. # # Written by Benedikt Meurer . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to : # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301, USA. # [Desktop Entry] Encoding=UTF-8 Version=1.0 Name=xnetcardconfig Comment=Configure network card Comment[de]=Netzwerkkarte konfigurieren Comment[fr]=Configuration de carte resau Exec=xnetcardconfig Icon=xnetcardconfig Terminal=false Type=Application Categories=System;HardwareSettings; xnetcardconfig-0.3.0/xnetcardconfig.in0000755002342000234200000000234312452220047016251 0ustar rzrrzr#!/bin/sh # # $Id: xnetcardconfig.in,v 1.1.1.1 2004/08/09 20:40:34 bmeurer Exp $ # # Copyright (c) 2004-2005 os-cillation # All rights reserved. # # Written by Benedikt Meurer . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to : # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301, USA. # if [ "`id -u`" = "0" ]; then exec "@PREFIX@/bin/xnetcardconfig.real" else (sudo -S $0) /dev/null 2>&1 || { (gksu -D /usr/share/applications/xfld-xnetcardconfig.desktop -- "$0") >/dev/null 2>&1 || { xmessage -center -file - <. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to : # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301, USA. # require 'gtk3' module Xfi class StockButton < Gtk::Button def initialize(text = nil, stock = nil) super() align = Gtk::Alignment.new(0.5, 0.5, 0, 0) align.show add align hbox = Gtk::HBox.new(false, 0) hbox.show align.add hbox @widget_image = Gtk::Image.new(stock, Gtk::IconSize::BUTTON) @widget_image.show hbox.pack_start(@widget_image, false, false, 2) @widget_label = Gtk::Label.new(text) @widget_label.show hbox.pack_start(@widget_label, false, false, 2) end private @widget_image @widget_label end class Wizard < Gtk::Window # Base class for pages class Page < Gtk::EventBox def initialize(title = nil) super() @title = title @can_next = @can_prev = TRUE end def title @title end def set_can_next(value) if @can_next != value; then @can_next = value @wizard.evaluate(self) end end def can_next @can_next end def set_can_prev(value) if @can_prev != value; then @can_prev = value @wizard.evaluate(self) end end def can_prev @can_prev end def wizard=(wizard) @wizard = wizard end def wizard @wizard end def activate end private @wizard @title @can_next @can_prev end def initialize super() set_border_width(10) @group = Gtk::SizeGroup.new(:both) @pages = Array.new box = Gtk::Box.new(:vertical, 10) box.show add box hbox = Gtk::Box.new(:horizontal, 10) hbox.show box.pack_start(hbox, true, true, 0) # the image on the left side vbox = Gtk::VBox.new(false, 0) vbox.show hbox.pack_start(vbox, false, false, 0) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN frame.show vbox.pack_start(frame, false, false, 0) @image = Gtk::Image.new('@PREFIX@/share/apps/xnetcardconfig/logo.png') @image.show frame.add(@image) vbox = Gtk::VBox.new(false, 10) vbox.show hbox.pack_start(vbox, true, true, 0) @label_title = Gtk::Label.new @label_title.modify_font(Pango::FontDescription.new('Sans Bold')) @label_title.set_alignment(0.0, 0.5) @label_title.show vbox.pack_start(@label_title, false, false, 0) separator = Gtk::HSeparator.new separator.show vbox.pack_start(separator, false, false, 0) @box = Gtk::EventBox.new @box.set_border_width(12) @box.show vbox.pack_start(@box, true, true, 0) # now on with the button box separator = Gtk::HSeparator.new separator.show box.pack_start(separator, false, false, 0) buttonbox = Gtk::HButtonBox.new buttonbox.layout_style = Gtk::ButtonBox::END buttonbox.spacing = 10 buttonbox.show box.pack_start(buttonbox, false, false, 0) @button_cancel = StockButton.new('Cancel', Gtk::Stock::CANCEL) @button_cancel.signal_connect('clicked') do destroy end @button_cancel.show buttonbox.pack_start(@button_cancel, false, false, 0) @button_prev = StockButton.new('Previous', Gtk::Stock::GO_BACK) @button_prev.sensitive = FALSE @button_prev.signal_connect('clicked') do back end @button_prev.show buttonbox.pack_start(@button_prev, false, false, 0) @button_next = StockButton.new('Next', Gtk::Stock::GO_FORWARD) @button_next.sensitive = FALSE @button_next.signal_connect('clicked') do forward end @button_next.show buttonbox.pack_start(@button_next, false, false, 0) @button_finish = StockButton.new('Done', Gtk::Stock::OK) @button_finish.signal_connect('clicked') do destroy end buttonbox.pack_start(@button_finish, false, false, 0) end def append(page) page.wizard = self @group.add_widget(page) @pages.push(page) activate((@current == nil) ? page : @current) end def evaluate(page) if page == @current; then @button_prev.sensitive = (@pages.first != page and page.can_prev) if @pages.last == page then @button_finish.sensitive = page.can_next @button_finish.show @button_next.hide else @button_finish.hide @button_next.show @button_next.sensitive = page.can_next end end end private def activate(page) @label_title.text = page.title @box.child != nil and @box.remove @box.child @box.add page @button_prev.sensitive = (@pages.first != page and page.can_prev) if @pages.last == page then @button_finish.sensitive = page.can_next @button_finish.show @button_next.hide else @button_finish.hide @button_next.show @button_next.sensitive = page.can_next end if @current != page then @current = page page.activate page.show end end def back if @pages.first != @current then activate(@pages[@pages.index(@current) - 1]) end end def forward if @pages.last != @current then activate(@pages[@pages.index(@current) + 1]) end end end end class NetworkInfo def initialize(interface) IO.popen("env LC_ALL=C LANG=C /sbin/ifconfig #{interface}") do |file| file.each_line do |line| line =~ /inet addr:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ and @address = $1 line =~ /Mask:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ and @netmask = $1 end end IO.popen('env LC_ALL=C LANG=C /bin/netstat -rn') do |file| file.each_line do |line| dest, gateway, others = line.split(' ') dest == '0.0.0.0' and @gateway = gateway end end @nameservers = Array.new File.open('/etc/resolv.conf', 'r') do |file| file.each_line do |line| if line =~ /^nameserver +([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ then @nameservers.push $1 end end end end def address @address end def netmask @netmask end def gateway @gateway end def nameservers @nameservers end private @address @netmask @gateway @nameservers end class Global def Global.device=(device) @@device = device end def Global.device @@device end def Global.devices=(devices) @@devices = devices end def Global.devices @@devices end def Global.dhcp=(value) @@dhcp = value end def Global.dhcp? @@dhcp end def Global.address=(value) @@address = value end def Global.address @@address end def Global.netmask=(value) @@netmask = value end def Global.netmask @@netmask end def Global.gateway=(value) @@gateway = value end def Global.gateway @@gateway end def Global.nameserver=(value) @@nameserver = value end def Global.nameserver @@nameserver end private @@device = 'eth0' @@devices = Array.new @@dhcp = TRUE @@address = nil @@netmask = nil @@gateway = nil @@nameserver = nil end module Pages class Intro < Xfi::Wizard::Page def initialize super('Configure your network') align = Gtk::Alignment.new(0, 0, 1.0, 1.0) align.show add align vbox = Gtk::VBox.new(false, 30) vbox.show align.add vbox label = Gtk::Label.new("This wizard will guide you through the\n" \ "steps required to setup your network.\n" \ "\n" \ "At first you must choose the network\n" \ "card you want to configure from the\n" \ "list below.\n") label.set_alignment(0.0, 0.5) label.show vbox.pack_start(label, false, false, 0) @store = Gtk::ListStore.new(Gdk::Pixbuf, String, String) icon = Gdk::Pixbuf.new('@PREFIX@/share/apps/xnetcardconfig/card.png') count = 0; Global.devices.each do |device| iter = @store.append iter[COLUMN_ICON] = icon iter[COLUMN_TEXT] = "Network Card #{count} (#{device})" iter[COLUMN_DEV] = device count = count + 1 end frame = Gtk::ScrolledWindow.new frame.shadow_type = Gtk::SHADOW_IN frame.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) frame.show vbox.pack_start(frame, true, true, 0) @treeview = Gtk::TreeView.new(@store) @treeview.headers_visible = FALSE @treeview.selection.signal_connect('changed') do changed end @treeview.show frame.add @treeview column = Gtk::TreeViewColumn.new renderer = Gtk::CellRendererPixbuf.new column.pack_start(renderer, FALSE) column.set_attributes(renderer, :pixbuf => COLUMN_ICON) renderer = Gtk::CellRendererText.new column.pack_start(renderer, TRUE) column.set_attributes(renderer, :text => COLUMN_TEXT) @treeview.append_column(column) changed end private COLUMN_ICON = 0 COLUMN_TEXT = 1 COLUMN_DEV = 2 def changed iter = @treeview.selection.selected and Global.device = iter[COLUMN_DEV] end end class Type < Xfi::Wizard::Page def initialize super('Configure your network') align = Gtk::Alignment.new(0, 0, 1.0, 1.0) align.show add align vbox = Gtk::VBox.new(false, 30) vbox.show align.add vbox label = Gtk::Label.new("Do you want to use DHCP (Dynamic Host\n" \ "Configuration Protocol) to configure the\n" \ "network interface automatically or would\n" \ "you like to setup the interface manually?") label.set_alignment(0.0, 0.5) label.show vbox.pack_start(label, false, false, 0) box = Gtk::VBox.new(false, 10) box.show vbox.pack_start(box, false, false, 0) @button_dhcp = Gtk::RadioButton.new('Automatic configuration (DHCP)') @button_dhcp.signal_connect('toggled') do toggled end @button_dhcp.show box.pack_start(@button_dhcp, false, false, 0) @button_manual = Gtk::RadioButton.new(@button_dhcp,'Manual configuration') @button_manual.show box.pack_start(@button_manual, false, false, 0) frame = Gtk::ScrolledWindow.new frame.shadow_type = Gtk::SHADOW_IN frame.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) frame.show vbox.pack_start(frame, true, true, 0) @textview = Gtk::TextView.new @textview.can_focus = FALSE @textview.wrap_mode = 3 @textview.show frame.add @textview buffer = @textview.buffer buffer.tag_table.add(tag = Gtk::TextTag.new('b')) tag.weight = Pango::FontDescription::WEIGHT_BOLD # apply global setting if Global.dhcp?; then @button_dhcp.active = TRUE else @button_manual.active = TRUE end toggled end private def toggled if @button_dhcp.active?; then Global.dhcp = TRUE buffer = @textview.buffer buffer.delete(buffer.start_iter, buffer.end_iter) buffer.insert(buffer.end_iter, "Automatic configuration (DHCP)\n\n", 'b') buffer.insert(buffer.end_iter, "Choose this method if the network you " \ "are connected to has a DHCP server " \ "that is able to configure your computer.") else Global.dhcp = FALSE buffer = @textview.buffer buffer.delete(buffer.start_iter, buffer.end_iter) buffer.insert(buffer.end_iter, "Manual configuration\n\n", 'b') buffer.insert(buffer.end_iter, "You will have to enter all required " \ "information to configure the network " \ "interface. Choose this if unsure.") end end end class Execute < Xfi::Wizard::Page def initialize super('Configure your network') align = Gtk::Alignment.new(0, 0, 1, 1) align.show add align vbox = Gtk::VBox.new(false, 0) vbox.show align.add vbox @box_dhcp = create_dhcp vbox.pack_start(@box_dhcp, true, true, 0) @box_manual = create_manual @box_manual.show vbox.pack_start(@box_manual, true, true, 0) end def activate if Global.dhcp?; then @box_dhcp.show @box_manual.hide dhcp_perform else @box_dhcp.hide @box_manual.show end end private def dhcp_perform @label_dhcp.text = "Autoconfiguring #{Global.device}..." @label_dhcp_info.text = "The process of autoconfiguring a network\n" \ "interface can take some time, please stay\n" \ "patient.\n" @vbox_dhcp.show set_can_next(FALSE) set_can_prev(FALSE) timer = Gtk::timeout_add(100) do @progress_dhcp.pulse end thread = Thread.new do # cleanup first system("/sbin/pump -k -i \"#{Global.device}\"") rc = system("/sbin/pump -i \"#{Global.device}\"") Gtk::timeout_remove(timer) @vbox_dhcp.hide if not rc; then @label_dhcp_info.text = "The process of autoconfiguring the network\n" \ "interface failed. Maybe check your cable\n" \ "connection.\n" \ "\n" \ "You may want to go back now and try to\n" \ "manually configure the network interface\n" \ "instead.\n"; set_can_prev(TRUE) else @label_dhcp_info.text = "The network interface was successfully\n" \ "configured using DHCP. Click the button\n" \ "labeled \"Next\" to complete the network\n" \ "setup.\n" set_can_prev(TRUE) set_can_next(TRUE) end end end def create_dhcp box = Gtk::VBox.new(false, 30) box.show @vbox_dhcp = Gtk::VBox.new(false, 10) @vbox_dhcp.show box.pack_start(@vbox_dhcp, false, false, 0) @label_dhcp = Gtk::Label.new @label_dhcp.show @vbox_dhcp.pack_start(@label_dhcp, false, false, 0) frame = Gtk::EventBox.new frame.border_width = 12 frame.show @vbox_dhcp.pack_start(frame, false, true, 0) @progress_dhcp = Gtk::ProgressBar.new @progress_dhcp.pulse_step = 0.10 @progress_dhcp.show frame.add @progress_dhcp @label_dhcp_info = Gtk::Label.new @label_dhcp_info.show box.pack_start(@label_dhcp_info, false, false, 0) return box end def create_manual info = NetworkInfo.new(Global.device) box = Gtk::VBox.new(false, 30) box.show label = Gtk::Label.new("Please fill in the fields below:") label.set_alignment(0.0, 0.5) label.show box.pack_start(label, false, false, 0) table = Gtk::Table.new(4, 2) table.column_spacings = 6 table.row_spacings = 6 table.show box.pack_start(table, false, false, 0) label = Gtk::Label.new('Address:') label.set_alignment(1.0, 0.5) label.show table.attach(label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL) @entry_ip = Gtk::Entry.new @entry_ip.signal_connect('changed') do Global.address = @entry_ip.text end @entry_ip.text = info.address if info.address @entry_ip.show table.attach(@entry_ip, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL) label = Gtk::Label.new('Network mask:') label.set_alignment(1.0, 0.5) label.show table.attach(label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL) @entry_mask = Gtk::Entry.new @entry_mask.signal_connect('changed') do Global.netmask = @entry_mask.text end @entry_mask.text = info.netmask ? info.netmask : '255.255.255.0' @entry_mask.show table.attach(@entry_mask, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL) label = Gtk::Label.new('Gateway:') label.set_alignment(1.0, 0.5) label.show table.attach(label, 0, 1, 2, 3, Gtk::FILL, Gtk::FILL) @entry_gw = Gtk::Entry.new @entry_gw.signal_connect('changed') do Global.gateway = @entry_gw.text end @entry_gw.text = info.gateway if info.gateway @entry_gw.show table.attach(@entry_gw, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL) label = Gtk::Label.new('Nameserver:') label.set_alignment(1.0, 0.5) label.show table.attach(label, 0, 1, 3, 4, Gtk::FILL, Gtk::FILL) @entry_dns = Gtk::Entry.new @entry_dns.signal_connect('changed') do Global.nameserver = @entry_dns.text end @entry_dns.text = info.nameservers[0] if not info.nameservers.empty? @entry_dns.show table.attach(@entry_dns, 1, 2, 3, 4, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL) return box end end class Finish < Xfi::Wizard::Page def initialize super('Configure your network') align = Gtk::Alignment.new(0, 0, 1, 1) align.show add align vbox = Gtk::VBox.new(false, 30) vbox.show align.add vbox label = Gtk::Label.new("Your network was configured successfully. The\n" \ "current network configuration is shown below.\n" \ "Click the button labeled \"Done\" to quit this\n" \ "wizard.") label.set_alignment(0.0, 0.5) label.show vbox.pack_start(label, false, false, 0) align = Gtk::Alignment.new(0.5, 0.5, 1, 1) align.show vbox.pack_start(align, false, false, 0) table = Gtk::Table.new(4, 2) table.column_spacings = 6 table.row_spacings = 6 table.show align.add table label = Gtk::Label.new('Address:') label.set_use_markup true label.set_alignment(1.0, 0.5) label.show table.attach(label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL) @label_address = Gtk::Label.new('127.0.0.1') @label_address.selectable = true @label_address.set_alignment(0.0, 0.5) @label_address.show table.attach(@label_address, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL) label = Gtk::Label.new('Network mask:') label.set_use_markup true label.set_alignment(1.0, 0.5) label.show table.attach(label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL) @label_netmask = Gtk::Label.new('255.255.255.0') @label_netmask.selectable = true @label_netmask.set_alignment(0.0, 0.5) @label_netmask.show table.attach(@label_netmask, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL) label = Gtk::Label.new('Gateway:') label.set_use_markup true label.set_alignment(1.0, 0.5) label.show table.attach(label, 0, 1, 2, 3, Gtk::FILL, Gtk::FILL) @label_gateway = Gtk::Label.new('255.255.255.255') @label_gateway.selectable = true @label_gateway.set_alignment(0.0, 0.5) @label_gateway.show table.attach(@label_gateway, 1, 2, 2, 3, Gtk::FILL, Gtk::FILL) label = Gtk::Label.new('Nameserver(s):') label.set_use_markup true label.set_alignment(1.0, 0.0) label.show table.attach(label, 0, 1, 3, 4, Gtk::FILL, Gtk::FILL) @label_dns = Gtk::Label.new("127.0.0.1") @label_dns.selectable = true @label_dns.set_alignment(0.0, 0.0) @label_dns.show table.attach(@label_dns, 1, 2, 3, 4, Gtk::FILL, Gtk::FILL) label = Gtk::Label.new("To run this wizard again, right click on the\n" \ "desktop with your mouse and choose the entry\n" \ "\"Configure network card\" from the \"System\"\n" \ "menu.") label.show vbox.pack_start(label, false, false, 0) end def activate if not Global.dhcp? then system("/sbin/pump -k -i \"#{Global.device}\"") system("/sbin/ifconfig \"#{Global.device}\" \"#{Global.address}\" " \ "netmask \"#{Global.netmask}\" up") system("/sbin/route add default gw \"#{Global.gateway}\"") File.open('/etc/resolv.conf', 'w') do |file| file.puts("nameserver #{Global.nameserver}") end end # store config (Debian) if FileTest.writable? '/etc/network/interfaces'; then lines = Array.new File.open('/etc/network/interfaces', 'r') do |file| ignore_tabbed = false file.each_line do |line| if line =~ /#{Global.device}/; then ignore_tabbed = true elsif not (ignore_tabbed and line =~ /^\t/); then lines.push line.chomp ignore_tabbed = false end end end lines.push "auto #{Global.device}" if Global.dhcp?; then lines.push "iface #{Global.device} inet dhcp" else lines.push "iface #{Global.device} inet static" lines.push "\taddress #{Global.address}" if Global.address lines.push "\tnetmask #{Global.netmask}" if Global.netmask lines.push "\tgateway #{Global.gateway}" if Global.gateway end File.open('/etc/network/interfaces', 'w') do |file| lines.each do |line| file.puts line end end end info = NetworkInfo.new(Global.device) if info.address; then @label_address.text = info.address else @label_address.text = 'Unknown' end if info.netmask; then @label_netmask.text = info.netmask else @label_netmask.text = 'Unknown' end if info.gateway; then @label_gateway.text = info.gateway else @label_gateway.text = 'Unknown' end list = ''; info.nameservers.each do |ns| list != '' and list = list + "\n" list = list + ns end @label_dns.text = list end end end Gtk::init # find network interfaces File.open('/proc/net/dev', 'r') do |file| devices = Array.new file.each_line do |line| dev, other = line.strip.split(/\s*:\s*/) (dev =~ /^(eth|ath|wlan)[0-9]$/) and devices.push dev end Global.devices = devices end # check if any interfaces were found if Global.devices.empty?; then dialog = Gtk::MessageDialog.new(nil, 0, \ Gtk::MessageDialog::ERROR, \ Gtk::MessageDialog::BUTTONS_CLOSE, \ "No supported network cards were found.") dialog.run exit 0 end wizard = Xfi::Wizard.new wizard.title = 'Configure your network' wizard.append(Pages::Intro.new) wizard.append(Pages::Type.new) wizard.append(Pages::Execute.new) wizard.append(Pages::Finish.new) wizard.signal_connect('destroy') do Gtk::main_quit end wizard.show Gtk::main