diff options
Diffstat (limited to 'perl-install/standalone')
23 files changed, 0 insertions, 2887 deletions
diff --git a/perl-install/standalone/XFdrake b/perl-install/standalone/XFdrake deleted file mode 100755 index d98dba20f..000000000 --- a/perl-install/standalone/XFdrake +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/perl - -# XFdrake -# Copyright (C) 1999 MandrakeSoft (pixel@mandrakesoft.com) -# -# 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. - -use lib qw(/usr/lib/libDrakX); - -use interactive; -use standalone; -use modules; -use Xconfigurator; -use Xconfig; -use c; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: XFdrake [--xf3] [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; - -my $i = {}; - -$::force_xf3 = /-xf3/; -$::beginner = /-beginner/; -$::expert = /-expert/; -$::auto = /-auto/; -$::noauto = /-noauto/; -$::testing = /-testing/; -$i->{skiptest} = /-skiptest/; - -my $in = interactive->vnew('su', 'X'); - --r '/etc/modules.conf' and modules::mergein_conf('/etc/modules.conf'); - -my $f = "/usr/X11R6/lib/X11/Cards"; -$in->standalone::pkgs_install('XFree86', 'XFree86-75dpi-fonts') if (! -e $f); --e $f or die "install XFree86 first!\n"; - -`pidof xfs` > 0 or system("/etc/rc.d/init.d/xfs start") if !$i->{skiptest}; - -system("mount /proc 2>/dev/null"); # ensure /proc is mounted for pci probing - -begin: -Xconfig::getinfo($i); -Xconfig::getinfoFromXF86Config($i); #- take default from here at least. - -my $allowNVIDIA_rpms; -eval { - my (%list, %select); - local *F; - open F, "grep NVIDIA /var/lib/urpmi/depslist.ordered |"; - while (<F>) { - /(.*)-([^-]*)-([^-]*)\s+/ and $list{$1} = 1; - } - close F; - if ($list{NVIDIA_GLX}) { - my ($version, $release, $ext) = `uname -r` =~ /([^-]*)-([^-]*mdk)(\S*)/; - $ext and $ext = "-$ext"; - $list{"NVIDIA_kernel-$version-$release$ext"} or die "no NVIDIA kernel for current kernel"; - $select{"NVIDIA_kernel-$version-$release$ext"} = 1; - foreach (`rpm -q kernel kernel-smp kernel-entreprise kernel22 kernel22-smp kernel22-secure`) { - ($ext, $version, $release) = /kernel[^-]*(-[^-]*)-([^-]*)-([^-]*mdk)/; - $list{"NVIDIA_kernel-$version-$release$ext"} and $select{"NVIDIA_kernel-$version-$release$ext"} = 1; - } - $allowNVIDIA_rpms = [ keys(%select), "NVIDIA_GLX" ]; - } -}; - -$::isEmbedded and kill USR2, $::CCPID; -Xconfigurator::main('', $i, $in, { allowFB => $::expert, - allowNVIDIA_rpms => $allowNVIDIA_rpms }, sub { $in->standalone::pkgs_install(@_) }); -!$::isEmbedded and $in->exit(0); -kill USR1, $::CCPID; -goto begin; diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake deleted file mode 100755 index 8584aa4ae..000000000 --- a/perl-install/standalone/adduserdrake +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - -use common; -use interactive; -use standalone; -use any; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: adduserdrake [--beginner] [--expert] [<users...>]\n"; - -$::beginner = /-beginner/; -$::expert = /-expert/; - -my @etc_pass_fields = qw(name pw uid gid realname home shell); -my @shells = grep { -x $_ } map { "/bin/$_" } qw(bash tcsh zsh ash ksh); -my $isMD5 = cat_("/etc/pam.d/passwd") =~ /md5/; -my $isShadow = cat_("/etc/pam.d/passwd") =~ /shadow/; - - -my $users = []; -my $in; - -if (my @l = grep { ! /^-/ } @ARGV) { - $users = [ map { { name => $_, realname => $_ } } @l ]; -} else { - $in = interactive->vnew('su', 'user'); - any::ask_users('', $in, $users, $ENV{SECURE_LEVEL}); -} - -system("adduser", $_->{name}) foreach @$users; -any::addUsers('', $users); - -any::write_passwd_user('', $_, $isMD5) foreach @$users; -system("pwconv") if $isShadow; - -#$in->pkgs_install("autologin") if $o->{autologin}; -#any::set_autologin('', $o->{autologin}, $o->{desktop}); - -$in->exit(0) if $in; diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake deleted file mode 100755 index 01c0ed294..000000000 --- a/perl-install/standalone/diskdrake +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/perl - -# DiskDrake -# Copyright (C) 1999 MandrakeSoft (pixel@mandrakesoft.com) -# -# 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. - -# DiskDrake uses resize_fat which is a perl rewrite of the work of Andrew -# Clausen (libresize). -# DiskDrake is also based upon the libfdisk and the install from Red Hat Software - - -use lib qw(/usr/lib/libDrakX); -use common; -use diskdrake; -use standalone; -use interactive_gtk; -use detect_devices; -use fsedit; -use fs; -use log; -use c; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; - -print "EMBED\n" if $::isEmbedded; -print "XID : $::XID\n"; -print "CCPID : $::CCPID\n"; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: diskdrake [--expert] [--testing]\n"; - -$::expert = /-expert/; -$::testing = /-testing/; - -if ($>) { - $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; -} - - -#if ($ARGV[0] eq '-l') { -# $@ and print "Error\n"; -# $::expert = 1; -# print diskdrake::get_info($_, $hds->[0]) foreach fsedit::get_fstab($hds->[0]); -# exit !$@; -#} -my $in = interactive_gtk->new; -my ($hds, $lvms) = - catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) } - sub { - my ($err) = $@ =~ /(.*) at /; - $@ =~ /overlapping/ and $in->ask_warn('', $@), return 1; - $in->ask_okcancel(_("Error"), -[_("I can't read your partition table, it's too corrupted for me :( -I'll try to go on blanking bad partitions"), $err]); - }; - -$SIG{__DIE__} = sub { my $m = chomp_($_[0]); log::l("ERROR: $m") }; -my $fstab = [ fsedit::get_fstab(@$hds, @$lvms) ]; - -fs::get_mntpoints_from_fstab($fstab); -fs::check_mounted($fstab); -diskdrake::main($hds, $lvms, {}, $in); - -$in->exit(0); diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot deleted file mode 100755 index d0c718ded..000000000 --- a/perl-install/standalone/drakboot +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - - -use common; -use interactive; -use standalone; -use any; -use bootloader; -use detect_devices; -use fsedit; -use fs; -use c; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -local $_ = join '', @ARGV; - -/-h/ and die "usage: drakboot [--expert]\n"; - -$::expert = /-expert/; - -my $in = interactive->vnew('su', 'bootloader'); - -require 'bootlook.pm' if ref($in) =~ /gtk/; -lilo_choice(); - - -sub lilo_choice -{ - my $bootloader = bootloader::read('', '/etc/lilo.conf'); - local ($_) = `detectloader`; - $bootloader->{methods} = { lilo => 1, grub => !!/grub/i }; - - my ($hds) = catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) } sub { 1 }; - my $fstab = [ fsedit::get_fstab(@$hds) ]; - fs::get_mntpoints_from_fstab($fstab); - - $::expert=1; - - ask: - any::setupBootloader($in, $bootloader, $hds, $fstab, $ENV{SECURE_LEVEL}) or $in->exit(0); - eval { bootloader::install('', $bootloader, $fstab, $hds) }; - - if ($@) { - $in->ask_warn('', - [ _("Installation of LILO failed. The following error occured:"), - grep { !/^Warning:/ } cat_("/tmp/.error") ]); - unlink "/tmp/.error"; - goto ask; - } -} - !$::isEmbedded and $in->exit(0); - kill(USR1, $::CCPID); - goto ask; - diff --git a/perl-install/standalone/drakbug_report b/perl-install/standalone/drakbug_report deleted file mode 100755 index 02eabebdf..000000000 --- a/perl-install/standalone/drakbug_report +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - -use any; - -print any::report_bug(); diff --git a/perl-install/standalone/drakgw b/perl-install/standalone/drakgw deleted file mode 100755 index d4b7136b9..000000000 --- a/perl-install/standalone/drakgw +++ /dev/null @@ -1,758 +0,0 @@ -#!/usr/bin/perl - -# -# Guillaume Cottenceau (gc@mandrakesoft.com) -# -# Copyright 2000 MandrakeSoft -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -use lib qw(/usr/lib/libDrakX); - -use interactive; -use standalone; -use log; -use c; -use network::netconnect; -use detect_devices; - -use MDK::Common; - -$::isInstall and die "Not supported during install.\n"; - - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: drakgw [--version]\n"; -/-version/ and die 'version: $Id$ '."\n"; -$::isEmbedded or $::isWizard = 1; -$::Wizard_pix_up = "wiz_drakgw.png"; -$::Wizard_title = _("Internet Connection Sharing"); -$::direct = /-direct/; - - -my $sysconf_network = "/etc/sysconfig/network"; -my $conf_linuxconf = "/etc/conf.linuxconf"; -my $rc_firewall_generic = "/etc/rc.d/rc.firewall"; -my $rc_firewall_drakgw = "/etc/rc.d/rc.firewall.inet_sharing"; -my $rc_firewall_22 = "/etc/rc.d/rc.firewall.inet_sharing-2.2"; -my $rc_firewall_24 = "/etc/rc.d/rc.firewall.inet_sharing-2.4"; -my $dhcpd_conf = "/etc/dhcpd.conf"; -my $cups_conf = "/etc/cups/cupsd.conf"; -my $drakgw_setup = "/etc/sysconfig/inet_sharing"; - - -my ($kernel_version) = c::kernel_version() =~ /(...)/; -log::l("[drakgw] kernel_version $kernel_version"); - -$kernel_version eq '2.2' || $kernel_version eq '2.4' or die "Only for 2.2 or 2.4 kernels.\n"; - -my $in = interactive::vnew('su', 'default'); - -pur_gtk_mode() if $::isEmbedded && ref($in) =~ /gtk/; - -sub sys { system(@_) == 0 or log::l("[drakgw] Warning, sys failed for $_[0]") } - -sub outpend { my $f = shift; local *F; open F, ">>$f" or die "outpend in file $f failed: $!\n"; print F foreach @_; } - -sub start_daemons () -{ - my $cups_used = 0; - log::l("[drakgw] Starting daemons"); - if (-f "/etc/rc.d/init.d/cups") { - if (grep(/is running/, `/etc/rc.d/init.d/cups status`)) { - $cups_used = 1; - sys("/etc/rc.d/init.d/cups stop"); - } - } - grep(/is running/, `/etc/rc.d/init.d/dhcpd status 2> /dev/null`) and sys("/etc/rc.d/init.d/dhcpd stop"); - grep(/connection refused/, `/etc/rc.d/init.d/named status 2> /dev/null`) or sys("/etc/rc.d/init.d/named stop"); - sys("/etc/rc.d/init.d/network restart"); - sys("sh $rc_firewall_generic"); - - sys("/etc/rc.d/init.d/$_ start"), sys("/sbin/chkconfig --level 345 $_ on") foreach 'named', 'dhcpd'; - sys("/etc/rc.d/init.d/cups start") if $cups_used; - - substInFile { s/^INET_SHARING.*\n//; $_ .= "INET_SHARING=enabled\n" if eof } $drakgw_setup; -} - -sub stop_daemons () -{ - log::l("[drakgw] Stopping daemons"); - grep /is running/, `/etc/rc.d/init.d/dhcpd status` and sys("/etc/rc.d/init.d/dhcpd stop"); - grep /Connection refused/, `/etc/rc.d/init.d/named status 2>&1` or sys("/etc/rc.d/init.d/named stop"); - if ($kernel_version eq "2.2") { - sys("/sbin/ipchains -F"); - } else { - sys("/sbin/iptables -t nat -F"); - } - sys("/sbin/chkconfig --level 345 $_ off") foreach 'named', 'dhcpd'; - - substInFile { s/^INET_SHARING.*\n//; $_ .= "INET_SHARING=disabled\n" if eof } $drakgw_setup; -} - -sub fatal_quit ($) -{ - log::l("[drakgw] FATAL: $_[0]"); - undef $wait_configuring; - $in->ask_warn('', $_[0]); - quit_global($in, -1); -} - -begin: - -#- ********************************** -#- * 0th step: verify if we are already set up - -if (-f $drakgw_setup) { - $::Wizard_no_previous = 1; - - if (grep(/enabled/, cat_($drakgw_setup))) { - my $r = $in->ask_from_list_(_("Internet Connection Sharing currently enabled"), -_("The setup of Internet connection sharing has already been done. -It's currently enabled. - -What would you like to do?"), - [ __("disable"), __("reconfigure"), __("dismiss") ]) or quit_global($in, 0); - if ($r eq "disable") { - { - my $wait_disabl = $in->wait_message('', _("Disabling servers...")); - stop_daemons(); - } - foreach ($dhcpd_conf, $rc_firewall_22, $rc_firewall_24) { - renamef($_, "$_.drakgwdisable") or die "Could not rename $_ to $_.drakgwdisable" - } - log::l("[drakgw] Disabled"); - $::Wizard_finished = 1; - $in->ask_okcancel('', _("Internet connection sharing is now disabled.")); - quit_global($in, 0); - } - if ($r eq "dismiss") { - quit_global($in, 0); - } - } - elsif (grep(/disabled/, cat_($drakgw_setup))) - { - my $r = $in->ask_from_list_(_("Internet Connection Sharing currently disabled"), -_("The setup of Internet connection sharing has already been done. -It's currently disabled. - -What would you like to do?"), - [ __("enable"), __("reconfigure"), __("dismiss") ]); - if ($r eq "enable") { - foreach ($dhcpd_conf, $rc_firewall_22, $rc_firewall_24) { - rename($_, "$_.old") if -f $_; - rename("$_.drakgwdisable", $_) or die "Could not find configuration. Please reconfigure."; - } - { - my $wait_enabl = $in->wait_message('', _("Enabling servers...")); - start_daemons(); - } - log::l("[drakgw] Enabled"); - $::Wizard_finished = 1; - $in->ask_okcancel('', _("Internet connection sharing is now enabled.")); - quit_global($in, 0); - } - if ($r eq "dismiss") { - quit_global($in, 0); - } - } - else { - $in->ask_warn(_("Unrecognized config file"), _("Config file content could not be interpreted.")); - quit_global($in, -1); - } -} - - -#- ********************************** -#- * 1st step: detect/setup -step_ask_confirm: - -$::Wizard_no_previous = 1; - -$::direct or $in->ask_okcancel(_("Internet Connection Sharing"), -_("You are about to configure your computer to share its Internet connection. -With that feature, other computers on your local network will be able to use this computer's Internet connection. - -Note: you need a dedicated Network Adapter to set up a Local Area Network (LAN)."), 1) or quit_global($in, 0); - -undef $::Wizard_no_previous; - - -step_detectsetup: - -my @configured_devices = map { /ifcfg-(\S+)/ } `ls /etc/sysconfig/network-scripts/ifcfg*`; - -my %aliased_devices; -/^\s*alias\s+(eth[0-9])\s+(\S+)/ and $aliased_devices{$1} = $2 foreach cat_("/etc/modules.conf"); - -my $card_netconnect = network::netconnect::get_net_device(); -defined $card_netconnect and log::l("[drakgw] Information from netconnect: ignore card $card_netconnect"); - -my @cards = grep { - log::l("[drakgw] Have network card: $_"); - $_ ne $card_netconnect -} detect_devices::getNet(); -log::l("[drakgw] Available network cards: ", join(", ", @cards)); - -my $format = sub { - $aliased_devices{$_[0]} ? - _("Interface %s (using module %s)", $_[0], $aliased_devices{$_[0]}) : - _("Interface %s", $_[0]); -}; - -#- setup the network interface we shall use - -my $device; -if (!@cards) -{ - $in->ask_warn(_("No network adapter on your system!"), - _("No ethernet network adapter has been detected on your system. Please run the hardware configuration tool.")); - quit_global($in); -} -elsif (@cards == 1) -{ - $device = $cards[0]; - $in->ask_okcancel(_("Network interface"), -_("There is only one configured network adapter on your system: - -%s - -I am about to setup your Local Area Network with that adapter.", $format->($device)), 1) or goto step_ask_confirm; -} -else -{ - $device = $in->ask_from_listf(_("Choose the network interface"), - _("Please choose what network adapter will be connected to your Local Area Network."), - $format, - \@cards, - ) or goto step_ask_confirm; - defined $device or quit_global($in); -} -log::l("[drakgw] Choosing network card: $device\n"); - -grep(/$device/, @configured_devices) and - ($in->ask_okcancel('', _("Warning, the network adapter is already configured. I will reconfigure it.")) or goto step_detectsetup); - - -my $lan_address = "192.168.0"; - - -#- test for potential conflict with other networks - -foreach (grep { $_ ne $device } @configured_devices) -{ - grep(/$lan_address/, cat_("/etc/sysconfig/network-scripts/ifcfg-$_")) and - ($in->ask_warn('', _("Potential LAN address conflict found in current config of $_!\n")) or goto step_detectsetup); -} - - -#- test for potential conflict with previous firewall config - -if ($kernel_version eq '2.2') { - if (-f '/etc/sysconfig/ipchains' || -x '/sbin/ipchains' && listlength(`/sbin/ipchains -nL`) > 3) { - $in->ask_okcancel(_("Firewalling configuration detected!"), - _("Warning! An existing firewalling configuration has been detected. You may need some manual fix after installation.")) or goto step_detectsetup; - } -} else { - system('modprobe iptable_nat'); - if (-f '/etc/sysconfig/iptables' || -x '/sbin/iptables' && listlength(`/sbin/iptables -t nat -nL`) > 8) { - $in->ask_okcancel(_("Firewalling configuration detected!"), - _("Warning! An existing firewalling configuration has been detected. You may need some manual fix after installation.")) or goto step_detectsetup; - } -} - - -#- ********************************** -#- * 2nd step: configure - -$wait_configuring = $in->wait_message(_("Configuring..."), - _("Configuring scripts, installing software, starting servers...")); - -substInFile { s/^INTERFACE.*\n//; $_ .= "INTERFACE=$device\n" if eof } $drakgw_setup; - -#- setup the /etc/sysconfig/network-script/ script - -my $network_scripts = "/etc/sysconfig/network-scripts"; -my $ifcfg = "$network_scripts/ifcfg-$device"; -renamef($ifcfg, "$network_scripts/old.ifcfg-$device"); -output($ifcfg, qq(DEVICE=$device -BOOTPROTO=static -IPADDR=$lan_address.1 -NETMASK=255.255.255.0 -NETWORK=$lan_address.0 -BROADCAST=$lan_address.255 -ONBOOT=yes -)); - - -#- install and setup the RPM packages - -my $rpms_to_install; -my %rpm2file = ( ipchains => "/sbin/ipchains", - iptables => "/sbin/iptables", - dhcp => "/usr/sbin/dhcpd", - linuxconf => $conf_linuxconf, - bind => "/usr/sbin/named", - "caching-nameserver" => "/var/named/named.local"); - -$in->standalone::pkgs_install(grep { !-e $rpm2file{$_} } keys %rpm2file); --e $rpm2file{$_} or fatal_quit(_("Problems installing package $_")) foreach keys %rpm2file; - - -#- setup the masquerading configuration - -if (!-f $rc_firewall_generic) { - output($rc_firewall_generic, "#!/bin/sh -# -# Automatically generated by drakgw -[ -x $rc_firewall_drakgw ] && $rc_firewall_drakgw -"); - chmod 0700, $rc_firewall_generic; -} -elsif (!grep(/drakgw/, cat_($rc_firewall_generic))) { - outpend($rc_firewall_generic, " -# Automatically added by drakgw -[ -x $rc_firewall_drakgw ] && $rc_firewall_drakgw - -"); -} - -output($rc_firewall_drakgw, q(#!/bin/sh -KERNELMAJ=`uname -r | sed -e 's,\..*,,'` -KERNELMIN=`uname -r | sed -e 's,[^\.]*\.,,' -e 's,\..*,,'` - -if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -eq 2 ]; then - [ -x ) . $rc_firewall_22 . ' ] && ' . $rc_firewall_22 . q( -fi -if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -eq 4 ]; then - [ -x ) . $rc_firewall_24 . ' ] && ' . $rc_firewall_24 . q( -fi - )); - -chmod 0700, $rc_firewall_drakgw; - - -output($rc_firewall_22, -qq(#!/bin/sh -# -# rc.firewall - Initial SIMPLE IP Masquerade test for 2.1.x and 2.2.x kernels using IPCHAINS -# -# Load all required IP MASQ modules -# -# NOTE: Only load the IP MASQ modules you need. All current IP MASQ modules -# are shown below but are commented out from loading. - -# Needed to initially load modules -# -/sbin/depmod -a - -# Supports the proper masquerading of FTP file transfers using the PORT method -# -/sbin/modprobe ip_masq_ftp - -# Supports the masquerading of RealAudio over UDP. Without this module, -# RealAudio WILL function but in TCP mode. This can cause a reduction -# in sound quality -# -/sbin/modprobe ip_masq_raudio - -# Supports the masquerading of IRC DCC file transfers -# -/sbin/modprobe ip_masq_irc - - -# Supports the masquerading of Quake and QuakeWorld by default. This modules is -# for for multiple users behind the Linux MASQ server. If you are going to play -# Quake I, II, and III, use the second example. -# -# NOTE: If you get ERRORs loading the QUAKE module, you are running an old -# ----- kernel that has bugs in it. Please upgrade to the newest kernel. -# -#Quake I / QuakeWorld (ports 26000 and 27000) -#/sbin/modprobe ip_masq_quake -# -#Quake I/II/III / QuakeWorld (ports 26000, 27000, 27910, 27960) -/sbin/modprobe ip_masq_quake 26000,27000,27910,27960 - - -# Supports the masquerading of the CuSeeme video conferencing software -# -/sbin/modprobe ip_masq_cuseeme - -#Supports the masquerading of the VDO-live video conferencing software -# -/sbin/modprobe ip_masq_vdolive - - -#CRITICAL: Enable IP forwarding since it is disabled by default since -# -# Redhat Users: you may try changing the options in /etc/sysconfig/network from: -# -# FORWARD_IPV4=false -# to -# FORWARD_IPV4=true -# -echo 1 > /proc/sys/net/ipv4/ip_forward - - -# Dynamic IP users: -# -# If you get your IP address dynamically from SLIP, PPP, or DHCP, enable this following -# option. This enables dynamic-ip address hacking in IP MASQ, making the life -# with Diald and similar programs much easier. -# -#echo 1 > /proc/sys/net/ipv4/ip_dynaddr - - -# MASQ timeouts -# -# 2 hrs timeout for TCP session timeouts -# 10 sec timeout for traffic after the TCP/IP "FIN" packet is received -# 160 sec timeout for UDP traffic (Important for MASQ'ed ICQ users) -# -/sbin/ipchains -M -S 7200 10 160 - - -# DHCP: For people who receive their external IP address from either DHCP or BOOTP -# such as ADSL or Cablemodem users, it is necessary to use the following -# before the deny command. The "bootp_client_net_if_name" should be replaced -# the name of the link that the DHCP/BOOTP server will put an address on to? -# This will be something like "eth0", "eth1", etc. -# -# This example is currently commented out. -# -# -#/sbin/ipchains -A input -j ACCEPT -i bootp_clients_net_if_name -s 0/0 67 -d 0/0 68 -p udp - -# Enable simple IP forwarding and Masquerading -# -# NOTE: The following is an example for an internal LAN address in the 192.168.0.x -# network with a 255.255.255.0 or a "24" bit subnet mask. -# -# Please change this network number and subnet mask to match your internal LAN setup -# -/sbin/ipchains -P forward DENY -/sbin/ipchains -A forward -s $lan_address.0/24 -j MASQ - -# Let incoming packets arrive to our interface, in case there are some firewall rules to come -/sbin/ipchains -A input -i $device -j ACCEPT -)); -chmod 0700, $rc_firewall_22; - - -output($rc_firewall_24, qq(#!/bin/sh -# Load the NAT module (this pulls in all the others). -modprobe iptable_nat - -# Turn on IP forwarding -echo 1 > /proc/sys/net/ipv4/ip_forward - -# In the NAT table (-t nat), Append a rule (-A) after routing (POSTROUTING) -# which says to MASQUERADE the connection (-j MASQUERADE). -/sbin/iptables -t nat -A POSTROUTING -s $lan_address.0/24 -j MASQUERADE - -# Allows forwarding specifically to our LAN -/sbin/iptables -A FORWARD -s $lan_address.0/24 -j ACCEPT - -# Allow dhcp requests -/sbin/iptables -A INPUT -i $device -p udp --sport bootpc --dport bootps -j ACCEPT -/sbin/iptables -A INPUT -i $device -p tcp --sport bootpc --dport bootps -j ACCEPT -/sbin/iptables -A INPUT -i $device -p udp --sport bootps --dport bootpc -j ACCEPT -/sbin/iptables -A INPUT -i $device -p tcp --sport bootps --dport bootpc -j ACCEPT - -# Allow dns requests -/sbin/iptables -A INPUT -i $device -p udp --dport domain -j ACCEPT -/sbin/iptables -A INPUT -i $device -p tcp --dport domain -j ACCEPT -)); -chmod 0700, $rc_firewall_24; - - -#- be sure that FORWARD_IPV4 is enabled in /etc/sysconfig/network - -substInFile { s/^FORWARD_IPV4.*\n//; $_ .= "FORWARD_IPV4=true\n" if eof } $sysconf_network; - - -#- setup the DHCP server - -renamef($dhcpd_conf, "$dhcpd_conf.old"); -output($dhcpd_conf, qq(subnet $lan_address.0 netmask 255.255.255.0 { - # default gateway - option routers $lan_address.1; - option subnet-mask 255.255.255.0; - - option domain-name "homelan.org"; - option domain-name-servers $lan_address.1; - - range dynamic-bootp $lan_address.16 $lan_address.253; - default-lease-time 21600; - max-lease-time 43200; -} -)); - - -#- put the interface for the dhcp server in linuxconf config, for the /etc script of dhcpd - -substInFile { s/^DHCP.interface.*\n//; $_ .= "DHCP.interface $device\n" if eof } $conf_linuxconf; - - -#- Set up /etc/cups/cupsd.conf to make the broadcasting of the printer info -#- working correctly: -#- -#- 1. ServerName <server's IP address> # because clients do necessarily -#- # know the server's name -#- -#- 2. BrowseAddress <server's Broadcast IP> # broadcast printer info into -#- # the local network. -#- -#- 3. BrowseOrder Deny,Allow -#- BrowseDeny All -#- BrowseAllow <IP mask for local net> # Only accept broadcast signals -#- # coming from local network -#- -#- 4. <Location /> -#- Order Deny,Allow -#- Deny From All -#- Allow From <IP mask for local net> # Allow only machines of local -#- </Location> # network to access the server -#- -#- These steps are only done when the CUPS package is installed. - -substInFile { - s/^ServerName[^:].*\n//; $_ .= "ServerName $lan_address.1\n" if eof; - s/^BrowseAddress.*\n//; $_ .= "BrowseAddress $lan_address.255\n" if eof; - s/^BrowseOrder.*\n//; $_ .= "BrowseOrder Deny,Allow\n" if eof; - s/^BrowseDeny.*\n//; $_ .= "BrowseDeny All\n" if eof; - s/^BrowseAllow.*\n//; $_ .= "BrowseAllow $lan_address.*\n" if eof; -} $cups_conf; - - -#- Modify the root location block in /etc/cups/cupsd.conf - -if (-f $cups_conf) { - my @cups_conf_content = cat_($cups_conf); - my @root_location; my $root_location_start; my $root_location_end; - - # Cut out the root location block so that it can be treated seperately - # without affecting the rest of the file - if (grep(m|^\s*<Location\s+/\s*>|, @cups_conf_content)) { - $root_location_start = -1; - $root_location_end = -1; - # Go through all the lines, bail out when start and end line found - for (my $i = 0; $i < @cups_conf_content && $root_location_end == -1; $i++) { - if ($cups_conf_content[$i] =~ m|^\s*<\s*Location\s+/\s*>|) { - $root_location_start = $i; - } elsif (($cups_conf_content[$i] =~ m|^\s*<\s*/Location\s*>|) && ($root_location_start != -1)) { - $root_location_end = $i; - } - } - # Rip out the block and store it seperately - @root_location = splice(@cups_conf_content, $root_location_start, $root_location_end - $root_location_start + 1); - } else { - # If there is no root location block, create one - $root_location_start = @cups_conf_content; - @root_location = ("<Location />\n", "</Location>\n"); - } - - # Delete all former "Order", "Allow", and "Deny" lines from the root location block - s/^\s*Order.*//, s/^\s*Allow.*//, s/^\s*Deny.*// foreach @root_location; - - # Add the new "Order" and "Deny" lines, add an "Allow" line for the local network - splice(@root_location, -1, 0, $_) foreach ("Order Deny,Allow\n", "Deny From All\n", "Allow From 127.0.0.1\n", - "Allow From $lan_address.*\n"); - - # Put the changed root location block back into the file - splice(@cups_conf_content, $root_location_start, 0, @root_location); - - output $cups_conf, @cups_conf_content; -} - - -#- start the daemons - -start_daemons(); - - -#- bye-bye message - -undef $wait_configuring; - -$::Wizard_no_previous = 1; -$::Wizard_finished = 1; - -$in->ask_okcancel(_("Congratulations!"), -_("Everything has been configured. -You may now share Internet connection with other computers on your Local Area Network, using automatic network configuration (DHCP).")); - - -log::l("[drakgw] Installation complete, exiting\n"); -quit_global($in, 0); - -sub quit_global { - my ($in, $exitcode) = @_; - $in->exit($exitcode); - goto begin -} - -sub pur_gtk_mode -{ - require Gtk; - init Gtk; - my $setup_state = grep(/disabled/, cat_($drakgw_setup)) ? _("The setup has already been done, but it's currently disabled.") : - grep(/enabled/, cat_($drakgw_setup)) ? _("The setup has already been done, and it's currently enabled.") : - _("No Internet Connection Sharing has ever been configured."); - - my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; - $window1->signal_connect ( delete_event => sub { Gtk->exit(0); }); - $window1->set_position(1); - $window1->set_title(_("Internet connection sharing configuration")); - $window1->border_width(10); - my $vbox1 = new Gtk::VBox(0,0); - $window1->add($vbox1); - my $hbox1 = new Gtk::HBox(0,0); - $vbox1->pack_start($hbox1,1,1,0); - my $label1 = new Gtk::Label( -_("Welcome to the Internet Connection Sharing utility! - -%s - -Click on Configure to launch the setup wizard.", $setup_state)); - $hbox1->pack_start($label1,1,1,0); - my $hbox2 = new Gtk::HBox(0,0); - $vbox1->pack_start($hbox2,1,1,0); - - my $bbox1 = new Gtk::HButtonBox; - $vbox1->pack_start($bbox1,0,0,0); - $bbox1->set_layout(-end); - my $button_conf = new Gtk::Button _("Configure"); - $button_conf->signal_connect ( clicked => sub { - system("/usr/sbin/drakgw --wizard"); - }); - $bbox1->add($button_conf); - my $button_cancel = new Gtk::Button _("Cancel"); - $button_cancel->signal_connect ( clicked => sub { - kill(USR1, $::CCPID); - }); - $bbox1->add($button_cancel); - $window1->show_all(); - Gtk->main_iteration while Gtk->events_pending; - $::isEmbedded and kill USR2, $::CCPID; - Gtk->main; - Gtk->exit(0); - -} - - - - - - -#------------------------------------------------- -#- $Log$ -#- Revision 1.46 2001/08/06 13:11:35 yduret -#- use MDK::Common; -#- use network::netconnect; and update functions call from netconnect -#- -#- Revision 1.45 2001/07/24 22:39:28 prigaux -#- move to MDK::Common, bool->to_bool -#- -#- Revision 1.44 2001/05/16 11:13:21 damien -#- added icon management -#- -#- Revision 1.43 2001/05/15 14:36:31 gc -#- full path for iptables -#- -#- Revision 1.42 2001/04/12 13:50:24 gc -#- add some rule so later on tinyfirewall will not prevent everything from working -#- -#- Revision 1.41 2001/04/11 15:28:36 gc -#- kosmetik -#- -#- Revision 1.40 2001/04/11 15:16:34 gc -#- do i18n for title also -#- -#- Revision 1.39 2001/04/10 21:33:15 gc -#- add INTERFACE param in sysconfig parameter for smooth interoperation with bastille-firewall -#- -#- Revision 1.38 2001/04/09 18:09:38 yduret -#- deyvounification : remove some un-useful comments in code -#- -#- Revision 1.37 2001/04/09 16:29:20 gc -#- do not die when an initscript returns non-0 (initscripts too buggy) -#- -#- Revision 1.36 2001/04/09 11:39:40 gc -#- fix for when there is an already existing rc.firewall -#- complies with old format of drakgw so that upgrades will work -#- -#- Revision 1.35 2001/04/08 05:33:14 damien -#- updated -#- -#- Revision 1.34 2001/04/06 15:09:15 yduret -#- swap cancel/configure button -#- -#- Revision 1.33 2001/04/06 14:12:06 gc -#- - correct yvounetification in i18n stuff -#- - remove some remaining debugging printings -#- - add a bit more of explanations when starting drakgw in wizard mode -#- -#- Revision 1.32 2001/04/06 01:34:44 yduret -#- recoded a embedded && gtk mode -#- -#- Revision 1.31 2001/03/31 14:21:10 pablo -#- Updated po files and help messages (patch from Pixel) -#- -#- Revision 1.30 2001/03/29 11:52:15 damien -#- updated for new wiz png policy -#- -#- Revision 1.29 2001/03/26 15:29:01 gc -#- first attempt at pixelization of code (till's cups patches) -#- -#- Revision 1.28 2001/03/21 18:07:36 gc -#- honour embedded mode -#- -#- Revision 1.27 2001/03/13 16:23:29 gc -#- fix for bind -#- -#- Revision 1.26 2001/03/13 15:31:05 gc -#- - fix destructive parts of pixelization -#- - fix some own bugs -#- -#- Revision 1.25 2001/03/13 00:00:11 prigaux -#- pixelization -#- -#- Revision 1.24 2001/03/12 18:26:16 gc -#- - make it work as a wizard -#- - make it work with iptables (kernel-2.4) -#- -#- Revision 1.23 2001/03/01 00:18:17 damien -#- updated embedded mode -#- -#- Revision 1.22 2001/02/26 18:39:12 prigaux -#- pixelization -#- -#- Revision 1.21 2001/02/08 10:11:37 damien -#- implemented or updated embedded mode -#- -#- Revision 1.20 2001/02/08 07:00:41 damien -#- added embedded and (ugly) wizard mode. -#- -#- Revision 1.19 2001/01/10 00:32:42 prigaux -#- use standalone and standalone::pkgs_install -#- -#- Revision 1.18 2000/12/16 16:13:34 prigaux -#- use ldetect-lst -#- -#- Revision 1.17 2000/11/13 15:48:33 gc -#- Integrate Till's patches for better work with Cups. -#- -#- Revision 1.16 2000/10/10 15:31:50 gc -#- make only one call to urpmi in order to install all the needed rpm's -#- diff --git a/perl-install/standalone/draknet b/perl-install/standalone/draknet deleted file mode 100755 index 6389ab59b..000000000 --- a/perl-install/standalone/draknet +++ /dev/null @@ -1,656 +0,0 @@ -#!/usr/bin/perl - -# DrakNet - -# Copyright (C) 1999 MandrakeSoft (damien@mandrakesoft.com) -# -# 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. - -use lib qw(/usr/lib/libDrakX); - -use interactive; -use standalone; -use network::netconnect; -use network::ethernet; -use network::tools; -use network; -use c; - -my $xpm_path="/usr/share/libDrakX/pixmaps"; -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -$::isWizard = "@ARGV" =~ /--wizard/; -$::isEmbedded or $::isWizard=1; -$::Wizard_pix_up = "wiz_draknet.png"; -$::Wizard_title = "Network & Internet Configuration"; -local $_ = join '', @ARGV; - -#/-h/ and die "usage: draknet[--xf3] [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; - -my $netcnx = {}; -my $netc = {}; -my $intf = {}; -my @conx_type = ('modem', 'isdn_internal', 'isdn_external', 'adsl', 'cable', 'lan' ); - -#$::wizard_xpm = "/usr/share/pixmaps/internet.xpm"; - -my $in = vnew interactive('su', 'network'); - -MDK::Common::Globals::init( - in => $in, - prefix => '', - connect_file => "/etc/sysconfig/network-scripts/net_cnx_up", - disconnect_file => "/etc/sysconfig/network-scripts/net_cnx_down", - connect_prog => "/etc/sysconfig/network-scripts/net_cnx_pg" - ); - -$::isEmbedded && ref($in) =~ /gtk/ or goto dd; -require Gtk; -init Gtk; -my $expert_mode=0; -network::netconnect::read_net_conf('', $netcnx, $netc); -any::setup_thiskind_backend('net', undef); -my @all_cards = network::ethernet::conf_network_card_backend ($netc, $intf, undef, undef, undef, undef); -network::netconnect::load_conf($netcnx, $netc, $intf); - -my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; -$window1->signal_connect ( delete_event => sub { Gtk->exit(0); }); -$window1->set_position(1); -$window1->set_title(_("Network configuration (%d adapters)", @all_cards)); -$window1->border_width(10); -$::isEmbedded or $window1->set_usize(500, 400); -my $vbox1 = new Gtk::VBox(0,10); -$window1->add($vbox1); -my $hbox1 = new Gtk::HBox(0,0); -$vbox1->pack_start($hbox1,1,1,0); -$hbox1->pack_start(new Gtk::Label(_("Profile: ")),0,0,0); - -my $combo1 = new Gtk::Combo; -$combo1->set_popdown_strings (network::netconnect::get_profiles() ); -my $old_profile=$netcnx->{PROFILE}; -$combo1->entry->set_text($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default"); -$combo1->entry->set_editable(0); -$hbox1->pack_start($combo1,0,0,0); -my $button_del = new Gtk::Button(_("Del profile...")); -$button_del->signal_connect( clicked => sub { - my $dialog = new Gtk::Dialog(); - $dialog->set_position(1); - $dialog->vbox->set_border_width(10); - $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); }); - $dialog->vbox->pack_start(new Gtk::Label(_("Profile to delete:")),1,1,0); - my $combo_dialog = new Gtk::Combo; - $combo_dialog->set_popdown_strings ( grep { ! /default/ } network::netconnect::get_profiles() ); - $combo_dialog->entry->set_editable(0); - $dialog->vbox->pack_start($combo_dialog,1,1,0); - my $bbox_dialog = new Gtk::HButtonBox; - $dialog->action_area->add($bbox_dialog); - $bbox_dialog->set_layout(-end); - my $button_ok = new Gtk::Button _("OK"); - $button_ok->signal_connect ( clicked => sub { - network::netconnect::del_profile($netcnx, $combo_dialog->entry->get_text()); - $netcnx->{PROFILE} eq $combo_dialog->entry->get_text() and $netcnx->{PROFILE}="default"; - Gtk->main_quit(); - }); - $bbox_dialog->add($button_ok ); - my $button_cancel = new Gtk::Button _("Cancel"); - $button_cancel->signal_connect ( clicked => sub { Gtk->main_quit(); }); - $bbox_dialog->add($button_cancel); - $dialog->show_all; - $dialog->set_modal(1); - Gtk->main(); - $dialog->destroy; - $combo1->entry->set_text((-e "/etc/sysconfig/network-scripts/draknet_conf." . $combo1->entry->get_text) ? $combo1->entry->get_text : "default"); - $combo1->set_popdown_strings(network::netconnect::get_profiles()); - apply(); - }); -$hbox1->pack_start($button_del,0,0,5); -$button_del->set_sensitive(network::netconnect::get_profiles() > 1); -my $button_new = new Gtk::Button(_("New profile...")); -$button_new->signal_connect( clicked => sub { - my $dialog = new Gtk::Dialog(); - $dialog->set_position(1); - $dialog->vbox->set_border_width(10); - $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); }); - $dialog->vbox->pack_start(new Gtk::Label(_("Name of the profile to create:")),1,1,0); - my $entry_dialog = new Gtk::Entry; - $dialog->vbox->pack_start($entry_dialog,1,1,0); - my $bbox_dialog = new Gtk::HButtonBox; - $dialog->action_area->add($bbox_dialog); - $bbox_dialog->set_layout(-end); - my $button_ok = new Gtk::Button _("OK"); - $button_ok->signal_connect ( clicked => sub { - network::netconnect::add_profile($netcnx, $entry_dialog->get_text()); - $netcnx->{PROFILE} = $entry_dialog->get_text(); - Gtk->main_quit(); - }); - $bbox_dialog->add($button_ok ); - my $button_cancel = new Gtk::Button _("Cancel"); - $button_cancel->signal_connect ( clicked => sub { Gtk->main_quit(); }); - $bbox_dialog->add($button_cancel); - $dialog->show_all; - $dialog->set_modal(1); - Gtk->main(); - $dialog->destroy; - $combo1->entry->set_text((-e "/etc/sysconfig/network-scripts/draknet_conf." . $netcnx->{PROFILE}) ? $netcnx->{PROFILE} : "default"); - $combo1->set_popdown_strings(network::netconnect::get_profiles()); -}); -$hbox1->pack_start($button_new,0,0,5); -my $hbox2 = new Gtk::HBox(0,0); -$vbox1->pack_start($hbox2,1,1,0); -$hbox2->pack_start(new Gtk::Label(_("Hostname: ")),0,0,0); -my $hostname = chomp_(`hostname`); -my $label_host = new Gtk::Label($hostname); -$hbox2->pack_start($label_host,0,0,0); - -#$vbox1->pack_start(new Gtk::HSeparator,1,1,5); - -my $frame1 = new Gtk::Frame (_("Internet access")); -$vbox1->pack_start($frame1,1,1,0); -my $vbox_frame1 = new Gtk::VBox(0,0); -$vbox_frame1->set_border_width(5); -$frame1->add($vbox_frame1); -my $table1 = new Gtk::Table (3,3, 0); -$table1->set_border_width(5); -$table1->set_row_spacings(5); -$table1->set_col_spacings(5); -#$table1->border_width(10); -$vbox_frame1->pack_start($table1,1,1,0); -#attach (table, child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding) -#$table->attach($button[0], 0, 1, 0, 1, {expand=>1,fill=>1}, {expand=>1,fill=>1},0,0); -$table1->attach(new Gtk::Label(_("Type:")), 0, 1, 0, 1, 'fill', 'fill',0,0); -my $label4 = new Gtk::Label($netcnx->{type}); -$table1->attach($label4, 1, 2, 0, 1, 'fill', 'fill',0,0); -my $label5 = new Gtk::Label($netcnx->{type} eq 'lan' ? _("Gateway:") : _("Interface:")); -$table1->attach($label5, 0, 1, 1, 2, 'fill', 'fill',0,0); -my $label6 = new Gtk::Label($netcnx->{type} eq 'lan' ? $netc->{GATEWAY} : $netc->{NET_INTERFACE}); -$table1->attach($label6, 1, 2, 1, 2, 'fill', 'fill',0,0); -my $c=network::tools::connected(); -my $label7 = new Gtk::Label(_("Status:")); -$table1->attach($label7, 0, 1, 2, 3, 'fill', 'fill',0,0); -my $label8 = new Gtk::Label($c ? _("Connected") : _("Not connected")); -$table1->attach($label8, 1, 2, 2, 3, 'fill', 'fill',0,0); - -my $button2 = new Gtk::Button($c ? _("Disconnect...") : _("Connect...")); -$button2->signal_connect (clicked => sub { - my $dialog = new Gtk::Dialog(); - $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); }); - $dialog->set_position(1); - $dialog->vbox->set_border_width(10); - $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); }); - $dialog->vbox->pack_start(my $l = new Gtk::Label(""),1,1,0); - my $bbox_dialog = new Gtk::HButtonBox; - $dialog->action_area->add($bbox_dialog); - $bbox_dialog->set_layout(-end); - my $button_ok = new Gtk::Button _("OK"); - $button_ok->signal_connect ( clicked => sub { Gtk->main_quit(); }); - $button_ok->set_sensitive(0); - $bbox_dialog->add($button_ok ); - $dialog->show_all; - $dialog->set_modal(1); - if (!network::tools::connected()) { - $l->set(_("Starting your connection...")); - Gtk->main_iteration while Gtk->events_pending; - network::tools::connect_backend(); - foreach (1..10) { Gtk->main_iteration while Gtk->events_pending; sleep 1; } - my $up=network::tools::connected($netc); - $l->set($up ? _("The system is now connected to Internet.") : _("The system doesn't seem to be connected to internet. -Try to reconfigure your connection.")); - } else { - $l->set(_("Closing your connection...")); - Gtk->main_iteration while Gtk->events_pending; - network::tools::disconnect_backend(); - foreach (1..10) { Gtk->main_iteration while Gtk->events_pending; sleep 1; } - my $up=network::tools::connected(); - $l->set($up ? _("The connection is not closed. -Try to do it manually by running -/etc/sysconfig/network-scripts/net_cnx_down -in root.") : _("The system is now disconnected.") ); - } - $button_ok->set_sensitive(1); - Gtk->main(); - $dialog->destroy; - update(); - }); -$table1->attach($button2, 2, 3, 2, 3, 'fill', 'fill',0,0); - -#$table1->attach($button1, 2, 3, 1, 2, 'fill', 'fill',0,0); - -my $hbox_frame1_button = new Gtk::HBox(0,0); -my $button1 = new Gtk::Button(_("Configure Internet Access...")); -$button1->signal_connect( clicked => [ \&configure_net, '', $netcnx, $netc, $intf]); -$hbox_frame1_button->pack_start($button1, 0, 0, 0); -$vbox_frame1->pack_start($hbox_frame1_button,0,0,0); - -#$vbox1->pack_start(new Gtk::HSeparator,1,1,5); - -my $frame2 = new Gtk::Frame (_("LAN configuration")); -$vbox1->pack_start($frame2,1,1,0); -my $vbox2 = new Gtk::VBox(0,0); -$vbox2->set_border_width(5); -$frame2->add($vbox2); -my $clist1 = new_with_titles Gtk::CList(_("Adapter"), _("Interface"), _("IP address"), _("Protocol"), _("Driver")); -$clist1->set_column_auto_resize($_,1) foreach (0..4); -$clist1->column_titles_passive(); -$clist1->set_shadow_type('etched_out'); -$vbox2->pack_start($clist1, 0, 0, 5); -#$scrolled1->add_with_viewport($table2); - -my $ip_regexp = qr/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; -foreach (0..$#all_cards) { - my $ip; - if (-e "/sbin/ifconfig") { - local $_=`LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig "eth$_"`; - /inet addr\:$ip_regexp/; $ip = "$1.$2.$3.$4"; - } else { $ip=$intf->{"eth$_"}{IPADDR} } - $clist1->append($_+1, "eth$_", $ip , $intf->{"eth$_"}{BOOTPROTO}, $all_cards[$_]->[1]); - $clist1->set_selectable($_, 0); -} - -my $hbox3 = new Gtk::HBox(0,0); -my $button3 = new Gtk::Button(_("Configure Local Area Network...")); -$button3->signal_connect( clicked => [ \&configure_lan, '', $netcnx, $netc, $intf]); -$hbox3->pack_start($button3, 0, 0, 0); -$vbox2->pack_start($hbox3, 0, 0, 0); - -$vbox1->pack_start(new Gtk::HSeparator,1,1,5); - -my $bbox0 = new Gtk::HButtonBox; -$vbox1->pack_start($bbox0,0,0,0); -$bbox0->set_layout(-end); - - -my $button_wizard = new Gtk::Button _("Configure"); -$button_wizard->signal_connect ( clicked => sub { - $::isWizard = 1; - system("draknet --wizard"); -# netconnect::intro('', $netcnx, $in, sub { $in->standalone::pkgs_install(@_) }); - $combo1->entry->set_text((-e "/etc/sysconfig/network-scripts/draknet_conf." . $combo1->entry->get_text) ? $combo1->entry->get_text : "default"); - network::netconnect::load_conf($netcnx, $netc, $intf); - update(); - }); -$bbox0->add($button_wizard ); - -$vbox1->pack_start(new Gtk::HSeparator,1,1,5); - -my $bbox1 = new Gtk::HButtonBox; -$vbox1->pack_start($bbox1,0,0,0); -$bbox1->set_layout(-end); -#$bbox1->set_border_width(5); - -my $button_expert = new Gtk::Button _("Expert Mode"); -$button_expert->signal_connect ( clicked => sub { - foreach($button1, $button3) { $expert_mode ? $_->hide() : $_->show() } - $button_expert->child->set($expert_mode ? _("Expert Mode") : _("Normal Mode")); - $expert_mode = !$expert_mode; - }); -$bbox1->add($button_expert ); - -my $button_apply = new Gtk::Button _("Apply"); -$button_apply->signal_connect ( clicked => sub { - apply(); - }); -$button_apply->set_sensitive(0); -$bbox1->add($button_apply); - -my $button_cancel = new Gtk::Button _("Cancel"); -$button_cancel->signal_connect ( clicked => sub { - $combo1->entry->set_text($old_profile); - update(); - quit_global(); - }); -$bbox1->add($button_cancel); -my $button_ok = new Gtk::Button _("OK"); -$button_ok->signal_connect ( clicked => sub { - my $dialog = new Gtk::Dialog(); - $dialog->set_position(1); - $dialog->vbox->set_border_width(10); - my $label = new Gtk::Label(_("Please Wait... Applying the configuration")); - $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); }); - $dialog->vbox->pack_start($label,1,1,20); - $dialog->show_all; - Gtk->main_iteration while Gtk->events_pending; - apply(); - $dialog->destroy; - update(); - quit_global(); - }); -$bbox1->add($button_ok); -$combo1->entry->signal_connect( 'changed', sub { - network::netconnect::set_profile($netcnx, $combo1->entry->get_text()); - network::netconnect::load_conf($netcnx, $netc, $intf); - $netcnx->{$_}=$netc->{$_} foreach qw(NET_DEVICE NET_INTERFACE); - network::netconnect::set_net_conf($netcnx, $netc); - update(); - $button_apply->set_sensitive(1); - }); - -$window1->show_all(); -$_->hide foreach ($button1, $button3); -Gtk->main_iteration while Gtk->events_pending; -$::isEmbedded and kill USR2, $::CCPID; -my $tag = Gtk->timeout_add(5000, \&update); -Gtk->main; -Gtk->exit(0); - -dd: -network::netconnect::intro('', $netcnx, $in, sub { $in->standalone::pkgs_install(@_) }); -$in->exit(0); - - -sub apply { - - $old_profile=$netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default"; - network::netconnect::save_conf($netcnx, $netc, $intf); - network::configureNetwork2($in, $prefix, $netc, $intf, sub { $in->standalone::pkgs_install(@_) }); - $netcnx->{type} =~ /adsl/ or system("/sbin/chkconfig --del adsl 2> /dev/null"); - system("$prefix/etc/rc.d/init.d/network $_") foreach "stop", "start"; - $button_apply->set_sensitive(0); -} - -sub update { - my $h = chomp_(`hostname`); - $label_host->set ($h); - $label4->set($netcnx->{type}); - $label5->set($netcnx->{type} eq 'lan' ? _("Gateway:") : _("Interface:")); - $label6->set($netcnx->{type} eq 'lan' ? $netc->{GATEWAY} : $netc->{NET_INTERFACE}); - my $c = network::tools::connected(); - $label8->set($c ? _("Connected") : _("Not connected")); - $button2->child->set($c ? _("Disconnect...") : _("Connect...")); - $clist1->freeze(); - $clist1->clear(); - foreach (0..$#all_cards) { - my $ip; - if (-e "/sbin/ifconfig") { - local $_=`LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig "eth$_"`; - /inet addr\:$ip_regexp/; $ip = "$1.$2.$3.$4"; - } else { $ip=$intf->{"eth$_"}{IPADDR} } - $clist1->append($_+1, "eth$_", $intf->{"eth$_"}{IPADDR}, $intf->{"eth$_"}{BOOTPROTO}, $all_cards[$_]->[1]); - $clist1->set_selectable($_, 0); - } - $clist1->thaw(); - $button_del->set_sensitive(network::netconnect::get_profiles() > 1); - $tag = Gtk->timeout_add(5000, \&update); - 0; -} - -sub quit_global { - $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0); -} - -sub configure_lan { - my (undef, $prefix, $netcnx, $netc, $intf) = @_; - my $window = new Gtk::Window -toplevel; - my @infos; - my @conf_data; - - if (@all_cards < 1) { - my $dialog = new Gtk::Dialog(); - $dialog->set_position(1); - $dialog->vbox->set_border_width(10); - $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); }); - $dialog->vbox->pack_start(new Gtk::Label(_("You don't have any configured interface. -Configure them first by clicking on 'Configure'")),1,1,0); - my $bbox_dialog = new Gtk::HButtonBox; - $dialog->action_area->add($bbox_dialog); - $bbox_dialog->set_layout(-end); - my $button_ok = new Gtk::Button _("OK"); - $button_ok->signal_connect ( clicked => sub { - Gtk->main_quit(); - }); - $bbox_dialog->add($button_ok ); - $dialog->show_all; - $dialog->set_modal(1); - Gtk->main(); - $dialog->destroy; - return; - } - - $window->set_policy (1, 1, 1); - $window->signal_connect ( delete_event => sub { Gtk->main_quit; }); - $window->set_position(1); - $window->set_title(_("LAN configuration")); - $window->border_width(10); - my $vbox1 = new Gtk::VBox(0,0); - $window->add($vbox1); - $vbox1->pack_start(new Gtk::Label(_("LAN Configuration")),0,1,0); - my $notebook = new Gtk::Notebook; - $vbox1->pack_start($notebook,0,1,0); - $notebook->set_sensitive($netc->{NETWORKING} eq "yes"); - my @eth_data; - foreach (0..$#all_cards) { - my $vbox_local=new Gtk::VBox(0,0); - $vbox_local->set_border_width(10); - $vbox_local->pack_start(new Gtk::Label( _("Adapter %s: %s", $_+1 , "eth$_")),1,1,0); - # Eth${_}Hostname=$netc->{HOSTNAME} - # Eth${_}HostAlias=" . do { $netc->{HOSTNAME} =~ /([^\.]*)\./; $1 } . " - # Eth${_}Driver=$all_cards[$_]->[1] - @conf_data = ([_("IP address"), \$intf->{"eth$_"}{IPADDR}], - [_("Netmask"), \$intf->{"eth$_"}{NETMASK}], - [_("Boot Protocol"), \$intf->{"eth$_"}{BOOTPROTO}, ["static", "dhcp", "bootp"]], - [_("Started on boot"), \$intf->{"eth$_"}{ONBOOT} , ["yes", "no"]], - [_("DHCP client"), \$netcnx->{dhcp_client}] - ); - my $i=0; - foreach (@conf_data) { - $infos[2*$i]=new Gtk::HBox(0,0); - my $l=new Gtk::Label($_->[0]); - $l->set_justify('left'); - $infos[2*$i]->pack_start($l,1,1,0); - $vbox_local->pack_start($infos[2*$i],0,0,0); - if (defined $_->[2]) { - my $c=new Gtk::Combo(); - $c->set_popdown_strings(@{$_->[2]}); - $infos[2*$i+1]=$c->entry; - $infos[2*$i+1]->set_editable(0); - $infos[2*$i]->pack_start($c,0,0,0); - } else { - $infos[2*$i+1]=new Gtk::Entry(); - $infos[2*$i]->pack_start($infos[2*$i+1],0,0,0); - } - $infos[2*$i+1]->set_text(${$_->[1]}); - $i++; - } - # $clist1->append($_+1, "eth$_", $intf->{"eth$_"}{IPADDR}, $intf->{"eth$_"}{BOOTPROTO}, $all_cards[$_]->[1]); - # $clist1->set_selectable($_, 0); - my $hbox_local = new Gtk::HBox(0,0); - my $pix = my_gtk::gtkpng("/usr/share/libDrakX/pixmaps/eth_card_mini.png"); - $hbox_local->pack_start($pix,0,0,0); - $hbox_local->pack_start(new Gtk::Label("eth$_"),0,0,0); - $hbox_local->show_all; - $notebook->append_page($vbox_local, $hbox_local); - } - my $bbox1 = new Gtk::HButtonBox; - $vbox1->pack_start($bbox1,0,0,10); - $bbox1->set_layout(-end); - my $old_networking = $netc->{NETWORKING}; - my $button_able = new Gtk::Button $netc->{NETWORKING} eq "yes" ? _("Disable") : _("Enable"); - $button_able->signal_connect ( clicked => sub { - $netc->{NETWORKING} eq "yes" ? ($netc->{NETWORKING} = "no") : ($netc->{NETWORKING} = "yes"); - $notebook->set_sensitive($netc->{NETWORKING} eq "yes"); - $button_able->child->set($netc->{NETWORKING} eq "yes" ? _("Disable") : _("Enable")); - } ); - $bbox1->add($button_able); - my $button_ok = new Gtk::Button( _("OK") ); - $button_ok->signal_connect ( clicked => sub { - my $i=0; - foreach (@conf_data) { - ${$_->[1]}=$infos[2*$i+1]->get_text(); - $i++; - } - update(); - $button_apply->set_sensitive(1); - $window->destroy(); Gtk->main_quit; - }); - $bbox1->add($button_ok); - my $button_cancel = new Gtk::Button( _("Cancel") ); - $button_cancel->signal_connect ( clicked => sub { $netc->{NETWORKING}=$old_networking; $window->destroy(); Gtk->main_quit }); - $bbox1->add($button_cancel); - - $window->set_modal(1); - $window->show_all(); - $intf->{"eth$_"}{BOOTPROTO} eq "dhcp" or $infos[8]->hide; - $window->set_position('center_always'); - Gtk->main; -} - - -sub configure_net { - my (undef, $prefix, $netcnx, $netc, $intf) = @_; - if (!$netcnx->{type}) { - my $dialog = new Gtk::Dialog(); - $dialog->set_position(1); - $dialog->vbox->set_border_width(10); - $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); }); - $dialog->vbox->pack_start(new Gtk::Label(_("You don't have any internet connection. -Create one first by clicking on 'Configure'")),1,1,0); - my $bbox_dialog = new Gtk::HButtonBox; - $dialog->action_area->add($bbox_dialog); - $bbox_dialog->set_layout(-end); - my $button_ok = new Gtk::Button _("OK"); - $button_ok->signal_connect ( clicked => sub { - Gtk->main_quit(); - }); - $bbox_dialog->add($button_ok ); - $dialog->show_all; - $dialog->set_modal(1); - Gtk->main(); - $dialog->destroy; - return; - } - my $cnx={}; - my @infos; - $cnx=$netcnx->{$netcnx->{type}}; - my $auto_detect={}; - my $window = new Gtk::Window -toplevel; - $window->set_policy (1, 1, 1); - $window->signal_connect ( delete_event => sub { Gtk->main_quit; }); - $window->set_position(1); - $window->set_title(_("Internet connection configuration")); - $window->border_width(10); - my $vbox1 = new Gtk::VBox(0,0); - $window->add($vbox1); - $vbox1->pack_start(new Gtk::Label(_("Internet Connection Configuration")),0,1,0); - - $vbox1->pack_start(new Gtk::HSeparator,0,0,5); - my $table1 = new Gtk::Table (2, 4, 0); - $table1->set_row_spacings(5); - $table1->set_col_spacings(5); - $vbox1->pack_start($table1,0,0,0); - $table1->attach(new Gtk::Label(_("Profile: ")), 0, 1, 0, 1, 'fill', 'fill',0,0); - $table1->attach(new Gtk::Label(_($netcnx->{PROFILE})), 1, 2, 0, 1, 'fill', 'fill',0,0); - $table1->attach(new Gtk::Label(_("Connection type: ")), 0, 1, 1, 2, 'fill', 'fill',0,0); - $table1->attach(new Gtk::Label(_($netcnx->{type})), 1, 2, 1, 2, 'fill', 'fill',0,0); -# my $button1 = new Gtk::Button(_("Reconfigure using wizard...")); -# $table1->attach($button1, 2, 4, 0, 2, 'fill', 'fill',0,0); - $vbox1->pack_start(new Gtk::HSeparator,0,0,5); - - my $frame1 = new Gtk::Frame (_("Parameters")); - $vbox1->pack_start($frame1,1,1,0); - my $vbox2 = new Gtk::VBox(0,0); - $frame1->add($vbox2); - my $i=0; - my @conf_data = ([_("Card IRQ"), \$cnx->{irq}, 'label'], - [_("Card mem (DMA)"), \$cnx->{mem}, 'label'], - [_("Card IO"), \$cnx->{io}, 'label'], - [_("Card IO_0"), \$cnx->{io0}, 'label'], - [_("Card IO_1"), \$cnx->{io1}, 'label'], - [_("Your personal phone number"), \$cnx->{phone_in}, 'label'], - [_("Provider name (ex provider.net)"), \$netc->{DOMAINNAME2}], - [_("Provider phone number"), \$cnx->{phone_out}, 'label'], - [_("Provider dns 1 (optional)"), \$netc->{dnsServer2}], - [_("Provider dns 2 (optional)"), \$netc->{dnsServer3}], - [_("Account Login (user name)"), \$cnx->{login}, 'label'], - [_("Account Password"), \$cnx->{passwd}, 'label'], - [_("Dialing mode"), $cnx->{dialing_mode}, 'label', [ "auto", "manual"] ], - [_("Gateway"), \$netc->{GATEWAY}], - [_("Connection name"), \$cnx->{connection}, 'label'], - [_("Phone number"), \$cnx->{phone}, 'label'], - [_("Login ID"), \$cnx->{login}, 'label'], - [_("Password"), \$cnx->{passwd}, 'label'], - [_("Authentication"), \$cnx->{auth}, 'label', [ _("PAP"), _("Terminal-based"), _("Script-based") ] ], - [_("Domain name"), \$cnx->{domain}, 'label'], - [_("First DNS Server (optional)"), \$cnx->{dns1}, 'label'], - [_("Second DNS Server (optional)"), \$cnx->{dns2}, 'label'], - [_("Ethernet Card"), \$netc->{NET_DEVICE}, 'label', [ 'eth0', 'eth1', 'eth2', 'eth3', 'eth4', 'eth5','eth6', 'eth7', 'eth8', 'eth9' ]], - [_("DHCP Client"), \$netcnx->{dhcp_client}, 'label', ["dhcpcd", "dhcpxd", "dhcp-client"] ] -); - foreach (@conf_data) { - $infos[2*$i]=new Gtk::HBox(0,0); - my $l=new Gtk::Label($_->[0]); - $l->set_justify('left'); - $infos[2*$i]->pack_start($l,1,1,0); - $vbox2->pack_start($infos[2*$i],0,0,0); - if (defined $_->[2]) { - if ($_->[2] eq 'label') { - $infos[2*$i+1]=new Gtk::Entry(); - $infos[2*$i+1]->set_editable(0); - $infos[2*$i]->pack_start($infos[2*$i+1],0,0,0); - } else { - my $c=new Gtk::Combo(); - $c->set_popdown_strings(@{$_->[2]}); - $infos[2*$i+1]=$c->entry; - $infos[2*$i+1]->set_editable(0); - $infos[2*$i]->pack_start($c,0,0,0); - } - } else { - $infos[2*$i+1]=new Gtk::Entry(); - $infos[2*$i]->pack_start($infos[2*$i+1],0,0,0); - } - $infos[2*$i+1]->set_text(${$_->[1]}); - $i++; - } - my @mask; -@mask=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) if $netcnx->{type}eq'lan'; -@mask=(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) if $netcnx->{type}eq'isdn_internal' -&& defined $cnx->{vendor} && defined $cnx->{id}; -@mask=(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) if $netcnx->{type}eq'isdn_internal' -&& (!defined $cnx->{vendor} || !defined $cnx->{id}); -@mask=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0) if ($netcnx->{type}eq'modem'||$netcnx->{type} eq 'isdn_external'); -@mask=(0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0) if $netcnx->{type} =~ 'adsl'; -@mask=(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1) if $netcnx->{type} eq 'cable'; - $vbox1->pack_start(new Gtk::HSeparator,0,0,5); - - - my $bbox1 = new Gtk::HButtonBox; - $vbox1->pack_start($bbox1,0,0,0); - $bbox1->set_layout(-end); - my $button_ok = new Gtk::Button _("OK"); - $button_ok->signal_connect ( clicked => sub { - $i=0; - foreach (@mask) { - if ($_) { - ${$conf_data[$i]->[1]}=$infos[2*$i+1]->get_text(); - } - $i++; - } - update(); - $button_apply->set_sensitive(1); - $window->destroy(); Gtk->main_quit; - }); - $bbox1->add($button_ok); - my $button_cancel = new Gtk::Button _("Cancel"); - $button_cancel->signal_connect ( clicked => sub { $window->destroy(); Gtk->main_quit }); - $bbox1->add($button_cancel); - - $window->set_modal(1); - $window->show_all(); - $i=0; - foreach (@mask) { - if ($_) { $infos[2*$i]->show } - else { $infos[2*$i]->hide; } - $i++; - } - $window->set_position('center_always'); - Gtk->main; -} diff --git a/perl-install/standalone/drakproxy b/perl-install/standalone/drakproxy deleted file mode 100755 index 6a10e9a41..000000000 --- a/perl-install/standalone/drakproxy +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/perl - -# -# DindinX (odin@mandrakesoft.com) -# -# Copyright 2001 MandrakeSoft -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -use lib qw(/usr/lib/libDrakX); - -use interactive; -use standalone; -use proxy; - -use my_gtk qw(:helpers :wrappers); -# use detect_devices; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: drakproxy [--version]\n"; -/-version/ and die 'version: drakproxy 1.0 2001/05/22 dindinx'."\n"; -$::isEmbedded or $::isWizard = 1; -$::Wizard_pix_up = "wiz_drakgw.png"; # FIXME -$::Wizard_title = _("Proxy handling"); - -my $in = interactive::vnew('su', 'default'); - -if ($::isWizard || ($::isEmbedded && ref($in) =~ /gtk/)) { - proxy::main('', $in, sub { $in->standalone::pkgs_install(@_) }); - $in->exit(0); -} - -# pure gtk_mode -my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; -$window1->signal_connect ( delete_event => sub { Gtk->exit(0); }); -$window1->set_position(1); -$window1->set_title(_("Proxy configuration")); -$window1->border_width(10); -gtkshow(gtkadd($window1, - gtkpack_(new Gtk::VBox(0,0), - 1, gtkpack(new Gtk::HBox(0,0), - new Gtk::Label _("Welcome to the Proxy Connection utility - -Click on Configure to launch the setup wizard."), - ), - 1, gtkpack(my $hbox2 = new Gtk::HBox(0,0),), - 0, gtkadd(gtkset_layout(new Gtk::HButtonBox, -end), - gtksignal_connect(new Gtk::Button(_("Configure")), clicked => sub { system ("/usr/sbin/drakproxy --wizard") }), - gtksignal_connect(new Gtk::Button(_("Cancel")), clicked => sub { kill(USR1, $::CCPID) }), - ) - ) - ) - ); -Gtk->main_iteration while Gtk->events_pending; -$::isEmbedded and kill USR2, $::CCPID; -Gtk->main; -Gtk->exit(0); - -#------------------------------------------------- -#- $Log$ -#- Revision 1.5 2001/06/12 12:45:57 odin -#- ui for drakproxy almost done -#- -#- Revision 1.4 2001/06/11 16:34:49 damien -#- corrected CVS: ---------------------------------------------------------------------- -#- -#- Revision 1.2 2001/06/11 16:03:10 damien -#- perlised -#- -#- Revision 1.1 2001/06/11 15:22:41 odin -#- first import of drakproxy -#- -#- diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec deleted file mode 100755 index c3b325d1e..000000000 --- a/perl-install/standalone/draksec +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - -use common; -use interactive; -use standalone; -use mouse; -use c; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: draksec [--expert]\n"; - -$::expert = /-expert/ || cat_("/etc/sysconfig/system") =~ /^CLASS="?expert/m; #" -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; - -my $in = vnew interactive('su', 'security'); - -my %m = reverse (my %l = ( - 0 => _("Welcome To Crackers"), - 1 => _("Poor"), - 2 => _("Low"), - 3 => _("Medium"), - 4 => _("High"), - 5 => _("Paranoid"), -)); -my %help = ( - 0 => _("This level is to be used with care. It makes your system more easy to use, -but very sensitive: it must not be used for a machine connected to others -or to the Internet. There is no password access."), - 1 => _("Password are now enabled, but use as a networked computer is still not recommended."), - 2 => _("Few improvements for this security level, the main one is that there are -more security warnings and checks."), - 3 => _("This is the standard security recommended for a computer that will be used -to connect to the Internet as a client. There are now security checks. "), - 4 => _("With this security level, the use of this system as a server becomes possible. -The security is now high enough to use the system as a server which accept -connections from many clients. "), - 5 => _("We take level 4 features, but now the system is entirely closed. -Security features are at their maximum."), -); - -delete @l{0,1,5} unless $::expert; -delete @help{0,1,5} unless $::expert; - -begin: -$::isEmbedded and kill USR2, $::CCPID; - -$secure_level = ${{ getVarsFromSh("/etc/profile") }}{SECURE_LEVEL} || $ENV{SECURE_LEVEL} || 2; - -if (my $level = $in->ask_from_list('', _("Choose security level") . "\n\n" . - join('', map { "$l{$_}: $help{$_}\n\n" } keys %l), - [ values %l ], $l{$secure_level})) { - my $w = $in->wait_message('', _("Setting security level")); - $in->suspend; - - $ENV{LILO_PASSWORD} = ''; # make it non interactive - system "/usr/sbin/msec", $m{$level}; - - $in->resume; -} - -!$::isEmbedded ? $in->exit(0) : kill(USR1, $::CCPID); -goto begin; diff --git a/perl-install/standalone/drakxconf b/perl-install/standalone/drakxconf deleted file mode 100755 index f7a4fb794..000000000 --- a/perl-install/standalone/drakxconf +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - - -use interactive; -use standalone; -use keyboard; -use Xconfigurator_consts; -use common; -use c; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: drakxconf\n"; - -my $in = vnew interactive('su'); -my @l=( - { des => 'Display Configuration', - cmd => 'XFdrake'}, - { des => 'Hard Drive Configuration', - cmd => 'diskdrake'}, - { des => 'KeyBoard Configuration', - cmd => 'keyboarddrake'}, - { des => 'Mouse Configuration', - cmd => 'mousedrake'}, - { des => 'Hardware Information', - cmd => 'harddrake'}, - { des => 'Internet & Network', - cmd => 'draknet'}, - { des => 'Firewalling', - cmd => 'tinyfirewall'}, - { des => 'Printer Configuration', - cmd => 'printerdrake'}, - { des => 'Add new users', - cmd => 'adduserdrake'}, - { des => 'Service Configuration', - cmd => 'drakxservices'}, - { des => 'Security Levels', - cmd => 'draksec'}, - { des => 'Boot Configuration', - cmd => 'drakboot'}, - ); -my $choice = $in->ask_from_listf(_("Control Center"), - _("Choose the tool you want to use"), - sub { (int grep { -x "$_/" . $_[0]{cmd} } split (":", $ENV{PATH})) ? $_[0]{des} : () },#grep { my $prog = $_; int grep { -x "$_/$prog" } split ":", $ENV{PATH} } $_[0]{des} }, - \@l ) or $in->exit(1); -$in->end; - -exec $choice->{cmd}, @ARGV or $in->exit(1); diff --git a/perl-install/standalone/drakxservices b/perl-install/standalone/drakxservices deleted file mode 100755 index a7f750944..000000000 --- a/perl-install/standalone/drakxservices +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - -use common; -use interactive; -use standalone; -use services; -use log; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: drakxservices\n"; - - -my $in = vnew interactive('su', 'services'); -begin: -my $l = services::ask($in); -services::doit($in, $l) if $l; -!$::isEmbedded and $in->exit(0); -kill USR1, $::CCPID; -goto begin; diff --git a/perl-install/standalone/icons/fileopen.xpm b/perl-install/standalone/icons/fileopen.xpm deleted file mode 100644 index 74049e224..000000000 --- a/perl-install/standalone/icons/fileopen.xpm +++ /dev/null @@ -1,34 +0,0 @@ -/* XPM */ -/* Drawn by Mark Donohoe for the K Desktop Environment */ -/* See http://www.kde.org */ -static char*fileopen[]={ -"22 22 6 1", -"# c #000000", -"d c #808080", -"c c #c0c0c0", -"b c #ffffff", -"a c #dcdcdc", -". c None", -"......................", -"......................", -"............####......", -"...............##.#...", -"................###...", -"................###...", -"...............####...", -"....####..............", -"....#aba#######.......", -"....#babababab#.......", -"....#aa##########.....", -"....#ba#aacccccd#.....", -"....#a#aacacccd#......", -"....#a#aacccdcd#......", -"....##aacacccd#.......", -"....##aacccdcd#.......", -"....#dddddddd#........", -"....##########........", -"......................", -"......................", -"......................", -"......................"}; - diff --git a/perl-install/standalone/icons/find.xpm b/perl-install/standalone/icons/find.xpm deleted file mode 100644 index 3145ca7fe..000000000 --- a/perl-install/standalone/icons/find.xpm +++ /dev/null @@ -1,34 +0,0 @@ -/* XPM */ -/* Drawn by Mark Donohoe for the K Desktop Environment */ -/* See http://www.kde.org */ -static char*find[]={ -"22 22 6 1", -"# c #000000", -"c c #ffffff", -"b c #dcdcdc", -"a c #a0a0a4", -"d c #dcdcdc", -". c None", -"......................", -"......................", -"......................", -".......####...........", -".....a#bccd#a.........", -".....#ccaacc#a........", -"....#dcaccccd#........", -"....#cccccccc#........", -"....#cccccccc#........", -"....#dccccccd#........", -"....a#cccccc#a........", -".....a#dccd###........", -"......a####a###.......", -".......aaaaaa###......", -"............aa###.....", -".............aa###....", -"..............aa###...", -"...............aa#a...", -"................aa....", -"......................", -"......................", -"......................"}; - diff --git a/perl-install/standalone/icons/findf.xpm b/perl-install/standalone/icons/findf.xpm deleted file mode 100644 index 792007335..000000000 --- a/perl-install/standalone/icons/findf.xpm +++ /dev/null @@ -1,31 +0,0 @@ -/* XPM */ -static char * findf_xpm[] = { -"16 22 6 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #0000FF", -"# c #BEBEFF", -"$ c #C0C0C0", -" ", -" ", -" ", -" ........... ", -".+++++++++++. ", -".++++++++@#+. ", -".+++++++++@+. ", -".++++$...$++. ", -".+++$.+++.$+. ", -".+++.+#+#+.+. ", -".+++.+@@++.+. ", -".+++.++@#+.+. ", -".+++$.+++..+. ", -".@#++$....+.. ", -".+@+++++++.+. ", -".++++++++++.+. ", -".++@#+++++++.+. ", -" ........... .+.", -" . ", -" ", -" ", -" "}; diff --git a/perl-install/standalone/icons/ftin.xpm b/perl-install/standalone/icons/ftin.xpm deleted file mode 100644 index d0326d3ce..000000000 --- a/perl-install/standalone/icons/ftin.xpm +++ /dev/null @@ -1,30 +0,0 @@ -/* XPM */ -static char * ftin_xpm[] = { -"15 22 5 1", -" c None", -". c #CD0000", -"+ c #FFFFFF", -"@ c #C0C0C0", -"# c #808080", -" ", -" ", -" ", -" ", -" ", -" . . ", -" ... ", -" ...++++++++", -" ...@@@@@@++", -" .......+++++#", -" .....@@@++#+", -" ++...+++++#+#", -" +@@@.@@@++#+#+", -"++++++++++#+#+ ", -"##########+#+ ", -"++++++++++#+ ", -"##########+ ", -"++++++++++ ", -" ", -" ", -" ", -" "}; diff --git a/perl-install/standalone/icons/ftout.xpm b/perl-install/standalone/icons/ftout.xpm deleted file mode 100644 index b4e0135b8..000000000 --- a/perl-install/standalone/icons/ftout.xpm +++ /dev/null @@ -1,30 +0,0 @@ -/* XPM */ -static char * ftout_xpm[] = { -"15 22 5 1", -" c None", -". c #00008B", -"+ c #FFFFFF", -"@ c #C0C0C0", -"# c #808080", -" ", -" ", -" ", -" ", -" ", -" . ", -" ... ", -" .....+++++++", -" .......@@@@++", -" ...+++++++#", -" +...@@@@++#+", -" ++...+++++#+#", -" +@@.+.@@++#+#+", -"++++++++++#+#+ ", -"##########+#+ ", -"++++++++++#+ ", -"##########+ ", -"++++++++++ ", -" ", -" ", -" ", -" "}; diff --git a/perl-install/standalone/icons/reload.xpm b/perl-install/standalone/icons/reload.xpm deleted file mode 100644 index 658cf36f0..000000000 --- a/perl-install/standalone/icons/reload.xpm +++ /dev/null @@ -1,31 +0,0 @@ -/* XPM */ -/* Drawn by Mark Donohoe for the K Desktop Environment */ -/* See http://www.kde.org */ -static char*reload[]={ -"22 22 3 1", -"# c #808080", -"a c #000000", -". c None", -"......................", -"......................", -"......................", -"......................", -"........##aaa#........", -".......#aaaaaaa.......", -"......#aa#....#a......", -"......aa#.............", -".....aaa.......a......", -"...aaaaaaa....aaa.....", -"....aaaaa....aaaaa....", -".....aaa....aaaaaaa...", -"......a.......aaa.....", -".............#aa......", -"......a#....#aa#......", -".......aaaaaaa#.......", -"........#aaa##........", -"......................", -"......................", -"......................", -"......................", -"......................"}; - diff --git a/perl-install/standalone/keyboarddrake b/perl-install/standalone/keyboarddrake deleted file mode 100755 index d43ff7e02..000000000 --- a/perl-install/standalone/keyboarddrake +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - - -use interactive; -use keyboard; -use standalone; -use Xconfigurator_consts; -use common; -use c; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -local $_ = join '', @ARGV; - -/-h/ and die _("usage: keyboarddrake [--expert] [keyboard]\n"); - -$::expert = /-expert/; - -print "[$::expert]\n"; -my $keyboard=''; -if ($::expert) { ($keyboard) = grep { !/^-/ } @ARGV;} -print "[$keyboard]\n"; -my $in = interactive->vnew('su', 'keyboard'); - -begin: -$::isEmbedded and kill USR2, $::CCPID; -$keyboard ||= $in->ask_from_listf_(_("Keyboard"), - _("Please, choose your keyboard layout."), - \&keyboard::keyboard2text, - [ keyboard::keyboards() ], - keyboard::read()); -if ($keyboard) { - keyboard::keyboard2text($keyboard) or die "bad keyboard $keyboard\n"; - - my $isNotDelete = $::expert && !$in->ask_yesorno("BackSpace", _("Do you want the BackSpace to return Delete in console?"), 1); - - my $kmap = keyboard::keyboard2kmap($keyboard); - `loadkeys $kmap`; - - my $xkb = keyboard::keyboard2xkb($keyboard); - `setxkbmap $xkb`; - - my $f = "/etc/X11/XF86Config"; - my $g = "/etc/X11/XF86Config-4"; - - substInFile { - if (/^Section\s+"Keyboard"/ .. /^EndSection/) { - s|^(\s*XkbLayout\s+).*|$1"$xkb"| - and $_ .= join '', map { " $_\n" } @{$xkb_options{$xkb} || []}; - s,^(\s*(XkbVariant|XkbOptions)\s+).*,,; # remove existing one - } - } $f if -e $f && !$::testing; - - substInFile { - if (/Identifier\s+"Keyboard1"/ .. /^EndSection/) { - s|^(\s*Option\s+"XkbLayout"\s+).*|$1"$xkb"| - and $_ .= join '', map { /(\S+)(.*)/; qq( Option "$1" $2\n) } @{$xkb_options{$xkb} || []}; - s,^(\s*Option\s+"(XkbVariant|XkbOptions)"\s+).*,,; # remove existing one - } - } $g if -e $g && !$::testing; - - keyboard::write('', $keyboard, $isNotDelete); -} - -if ($::isEmbedded) { - kill(USR1, $::CCPID); - $keyboard = ''; - goto begin; -} else { - $in->exit(0); -} diff --git a/perl-install/standalone/livedrake b/perl-install/standalone/livedrake deleted file mode 100755 index 839339754..000000000 --- a/perl-install/standalone/livedrake +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - -use common; -use interactive; -use standalone; -use run_program; -use c; - -local $_ = join '', @ARGV; - -/-h/ and die "usage: livedrake [--testing]\n"; - -$::testing = /-testing/; - -my $in = vnew interactive('su'); - -my $cd_mntpoint = "/mnt/cdrom"; - -while (! -x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") { - ejectCdrom(); - $in->ask_okcancel(_("Change Cd-Rom"), -_("Please insert the Installation Cd-Rom in your drive and press Ok when done. -If you don't have it, press Cancel to avoid live upgrade."), 1) or $in->exit(0); - run_program::run("mount", "/mnt/cdrom"); -} - -if (-x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") { - chdir "/$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/"; - $::testing or exec "./live_install"; -} - -$in->ask_warn('', _("Unable to start live upgrade !!!\n")); -$in->exit(1); - -sub ejectCdrom { - my ($cdrom) = @_; - $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; - $cdrom or cat_("/etc/fstab") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; - my $f = eval { $cdrom && detect_devices::tryOpen($cdrom) } or return; - run_program::run("umount", "/mnt/cdrom"); - ioctl $f, c::CDROM_LOCKDOOR(), 0; - ioctl $f, c::CDROMEJECT(), 1; -} diff --git a/perl-install/standalone/mousedrake b/perl-install/standalone/mousedrake deleted file mode 100755 index bc99d6ede..000000000 --- a/perl-install/standalone/mousedrake +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/perl - -use lib qw(/usr/lib/libDrakX); - -use common; -use interactive; -use standalone; -use modules; -use detect_devices; -use mouse; -use c; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -local $_ = join '', @ARGV; - -/-h/ and die "usage: mousedrake [--auto] [--testing]\n"; - -$::auto = /-auto/; -$::testing = /-testing/; - -my $in = vnew interactive('su', 'mouse'); - --r '/etc/modules.conf' and modules::mergein_conf('/etc/modules.conf'); - -undef $::Plug; -begin: -my ($mouse) = mouse::detect() unless $::noauto; -my $time_tag2; - -$::isEmbedded and kill USR2, $::CCPID; -if (!$mouse || !$::auto) { - $mouse ||= mouse::fullname2mouse("serial|Generic 2 Button Mouse"); - if ($::isEmbedded && ref($in) =~ /gtk/) { - require my_gtk; - my $time_tag = Gtk->timeout_add(100, sub { - defined $::Plug && defined $::Plug->child or return 1; - test_mouse($mouse,$::Plug->child); - 0; - }); - } - my $name = $in->ask_from_treelistf('mousedrake', _("Please, choose the type of your mouse."), '|', - sub { join '|', map { translate($_) } split '\|', $_[0] }, - [ mouse::fullnames ], - $mouse->{type} . '|' . $mouse->{name}); - Gtk->timeout_remove($time_tag2) if $::isEmbedded && ref($in) =~ /gtk/; - $name or $::isEmbedded ? do { kill(USR1, $::CCPID); goto begin } : $in->exit(0); - $mouse = mouse::fullname2mouse($name); - - if ($mouse->{device} eq "usbmouse") { - my ($c) = grep { $_->{driver} =~ /usb-[ou]hci/ } detect_devices::pci_probe(0) or die _("no serial_usb found\n"); - eval { modules::load($c->{driver}, "serial_usb") }; - } -} -$mouse->{XEMU3} = 'yes' if $mouse->{nbuttons} < 3 && (!$::noauto || $in->ask_yesorno('', _("Emulate third button?"), 1)); - -$mouse->{device} = - $in->ask_from_listf(_("Mouse Port"), - _("Please choose on which serial port your mouse is connected to."), - \&mouse::serial_port2text, - [ mouse::serial_ports ]) || goto begin if $mouse->{type} eq 'serial'; - -#test_mouse($mouse) if $::isEmbedded; -mouse::write_conf($mouse); --e "/var/lock/subsys/gpm" and system "service", "gpm", "restart"; - -$::isEmbedded ? kill(USR1, $::CCPID) : $in->exit(0); -goto begin; - - -sub test_mouse { - my ($mouse, $hbox) = @_; - - my ($width, $height, $offset) = (210, round_up(min(350, $::windowheight - 150), 6), 25); - my ($bw, $bh) = ($width / 3, $height / 3); - - my $darea = new Gtk::DrawingArea; - $darea->set_events([ 'button_press_mask', 'button_release_mask' ]); #$darea must be unrealized. - my_gtk::gtkpack($hbox, my_gtk::gtkset_border_width(my_gtk::gtkpack(new Gtk::VBox(0,10), my_gtk::gtksize(my_gtk::gtkset_usize($darea, $width+1, $height+1), $width, $height)),10)); - my $draw_rect; $draw_rect = sub { - my ($black, $fill, $rect) = @_; - $draw_rect->(0, 1, $rect) if !$fill; #- blank it first - $darea->window->draw_rectangle($black ? $darea->style->fg_gc('normal') : $darea->style->bg_gc('normal'), $fill, @$rect); - $darea->draw($rect); - }; - my $paintWheel = sub { - my ($x, $y, $w, $h) = ($width / 2 - $bw / 6, $bh / 4, $bw / 3, $bh / 2); - $mouse->{nbuttons} = max($mouse->{nbuttons}, 5); #- it means, the mouse has more than 3 buttons... - $draw_rect->(1, 0, [ $x, $y, $w, $h ]); - - my $offset = 0 if 0; - $offset += $_[0] if $_[0]; - my $step = 10; - for (my $i = $offset % $step; $i < $h; $i += $step) { - $draw_rect->(1, 1, [ $x, $y + $i, $w, min(2, $h - $i) ]); - } - }; - my $paintButton = sub { - my ($nb, $pressed) = @_; - my $rect = [ $bw * $nb, 0, $bw, $bh ]; - $draw_rect->(1, $pressed, $rect); - $paintWheel->(0) if $nb == 1 && $mouse->{nbuttons} > 3; - }; - my $draw_text = sub { - my ($t, $y) = @_; - my $font = $darea->style->font; - my $w = $font->string_width($t); - $darea->window->draw_string($font, $darea->style->fg_gc('normal'), ($width - $w) / 2, $y, $t); - }; - my $default_time = 10; - my $time = $default_time; - my $expose1 = 0; - my $expose2 = 1; - $darea->signal_connect(button_press_event => sub { - my $b = $_[1]{button}; - $time = $default_time; - $b >= 4 ? - $paintWheel->($b == 4 ? -1 : 1) : - $paintButton->($b - 1, 1); - $expose2 = 0; - }); - $darea->signal_connect(button_release_event => sub { - my $b = $_[1]{button}; - $paintButton->($b - 1, 0) if $b < 4; - $expose2 = 1; - }); - $darea->signal_connect(expose_event => sub { $expose = 1 }); - $time_tag2 = Gtk->timeout_add(100, sub { - $expose && $expose2 or return 1; - $expose = 0; - $draw_rect->(1, 0, [ 0, 0, $width, $height]); - $draw_text->(_("Test the mouse here."), 2 * $bh - 20); - $draw_text->(_("To activate the mouse,"), 2 * $bh + 10) if $mouse->{XMOUSETYPE} eq 'IMPS/2'; - $draw_text->(_("MOVE YOUR WHEEL!"), 2 * $bh + 30) if $mouse->{XMOUSETYPE} eq 'IMPS/2'; - $paintButton->($_, 0) foreach 0..2; - $expose = 0; - 1; - }); -} diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor deleted file mode 100755 index 8cf3ca160..000000000 --- a/perl-install/standalone/net_monitor +++ /dev/null @@ -1,380 +0,0 @@ -#!/usr/bin/perl - -# Monitor - -# Copyright (C) 1999 MandrakeSoft (damien@mandrakesoft.com) -# -# 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. - -use Gtk; -use lib qw(/usr/lib/libDrakX); -use interactive; -use standalone; -use my_gtk qw(:helpers :wrappers); -#-use Data::Dumper; -use common; -use strict; -use network::netconnect; -use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file $connect_prog); - -my ($connect, $default_intf); -init Gtk; -my $in = vnew interactive('su'); -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -($default_intf) = "@ARGV" =~ /--defaultintf (\w+)/; -$connect = "@ARGV" =~ /--connect/; -my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; -$window1->signal_connect ( delete_event => sub { Gtk->exit(0); }); -$window1->set_position(1); -$window1->set_title(_("Network Monitoring")); -#$window1->set_policy(0, 0, 0); -$window1->set_border_width(5); -#$::isEmbedded or $window1->set_usize(600, 200); - -my $colorr = my_gtk::gtkcolor(50400, 655, 20000); -my $colort = my_gtk::gtkcolor(55400, 65400, 655); -my $colora = my_gtk::gtkcolor(655, 50400, 655); -my $isconnected=0; -my @interfaces; -my $monitor = {}; -my $netcnx = {}; -my $netc = {}; -my $intf = {}; -network::netconnect::load_conf($netcnx, $netc, $intf); -network::netconnect::read_net_conf('', $netcnx, $netc); -my $combo1 = new Gtk::Combo; -$combo1->set_popdown_strings (network::netconnect::get_profiles() ); -$combo1->entry->set_text($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default"); -$combo1->entry->set_editable(0); -MDK::Common::Globals::init( - in => $in, - prefix => '', - connect_file => "/etc/sysconfig/network-scripts/net_cnx_up", - disconnect_file => "/etc/sysconfig/network-scripts/net_cnx_down", - connect_prog => "/etc/sysconfig/network-scripts/net_cnx_pg" ); - -gtkadd($window1, - gtkpack_(new Gtk::VBox(0,5), - 0, _("Network Monitoring"), - 1, gtkpack_(new Gtk::HBox(0,5), - 1, my $notebook = new Gtk::Notebook, - 0, gtkpack_(new Gtk::VBox(0,5), - 1, gtkadd(gtkset_shadow_type(new Gtk::Frame(_("Settings")), 'etched_out'), - gtkpack__(gtkset_border_width(new Gtk::VBox(0,5),5), - gtkpack__(new Gtk::HBox(0,0), - _("Connection type: "), my $label_cnx_type = new Gtk::Label("")), - gtkpack__(new Gtk::HBox(0,0), - _("Profile: "), $combo1) - ) - ), - 0, gtkadd(gtkset_shadow_type(new Gtk::Frame(_("Statistics")), 'etched_out'), - create_packtable({ col_spacings => 1, row_spacings => 1}, - [ "", "instantaneous" , "average"], - [ _("Sending Speed:"), my $label_st = new Gtk::Label(""), my $label_sta=new Gtk::Label("na")], - [ _("Receiving Speed:"),my $label_sr= new Gtk::Label(""), my $label_sra=new Gtk::Label("na")], - ) -# gtkpack__(gtkset_border_width(new Gtk::VBox(0,5),5), -# gtkpack__(new Gtk::HBox(0,0), -# _("Sending Speed: "), my $label_st = new Gtk::Label("")), -# gtkpack__(new Gtk::HBox(0,0), -# _("Receiving Speed: "), my $label_sr = new Gtk::Label("")), - ), - 0, gtksignal_connect(my $button_connect = new Gtk::Button(), clicked => \&connection), - 0, new Gtk::HSeparator, - 0, gtksignal_connect(my $button_close = new Gtk::Button(_("Close")), clicked => sub { Gtk->exit(0) }) - ) - ), - 0, my $statusbar = new Gtk::Statusbar - ) - ); -$window1->realize; -$combo1->entry->signal_connect( 'changed', sub { - network::netconnect::set_profile($netcnx, $combo1->entry->get_text()); - network::netconnect::load_conf($netcnx, $netc, $intf); - network::netconnect::set_net_conf($netcnx, $netc, $intf); - network::netconnect::read_net_conf('', $netcnx, $netc); - }); -my $gct = new Gtk::Gdk::GC($window1->window); -$gct->set_foreground($colort); -my $gcr = new Gtk::Gdk::GC($window1->window); -$gcr->set_foreground($colorr); -my $gca = new Gtk::Gdk::GC($window1->window); -$gca->set_foreground($colora); -my ($pix_c_map, $pix_c_mask) = gtkcreate_png("net_c.png"); -my ($pix_d_map, $pix_d_mask) = gtkcreate_png("net_d.png"); -$button_connect->add(gtkpack__(new Gtk::VBox(0,3), - my $pix_c = new Gtk::Pixmap($pix_d_map, $pix_d_mask), - my $label_c = new Gtk::Label(_("Connect to Internet")) - )); -$statusbar->push(1, _("Not connected")); -$window1->show_all(); -#$window1->set_policy (1, 1, 1); -update(); -my ($labelr, $labelt); -my $time_tag = Gtk->timeout_add(1000, \&rescan); -my $time_tag2 = Gtk->timeout_add(5000, \&update); -rescan(); -connection() if ($connect && ! $isconnected); -Gtk->main; -Gtk->exit(0); - -sub connection { - my $isconnected2 = $isconnected; - $button_connect->set_sensitive(0); - $button_close->set_sensitive(0); - $statusbar->pop(1); - $statusbar->push(1, $isconnected2 ? _("Disconnecting from Internet ") : _("Connecting to Internet ")); - my $nb_point=1; - my $tag = Gtk->timeout_add(100, sub { - $statusbar->pop(1); - $statusbar->push(1, ($isconnected2 ? _("Disconnecting from Internet ") : _("Connecting to Internet ")) - . join('', map { "." } (1..$nb_point))); - $nb_point++; - 1; - }); - my $netc = {}; - my $tag2 = Gtk->timeout_add(10000, sub { - Gtk->timeout_remove($tag); - $statusbar->pop(1); - $statusbar->push(1, $isconnected2 ? ( network::netconnect::connected('', $netc) ? - _("Disconnection from Internet failed.") : - _("Disconnection from Internet complete.")) : - ( network::netconnect::connected('', $netc) ? - _("Connection complete.") : - _("Connection failed.\nVerify your configuration in the Mandrake Control Center.")) - ); - my $tag3 = Gtk->timeout_add(10000, sub { - $statusbar->pop(1); - $statusbar->push(1, network::netconnect::connected('', $netc) ? _("Connected") : _("Not connected")); - 0; - }); - $button_connect->set_sensitive(1); - $button_close->set_sensitive(1); - 0; - }); - Gtk->main_iteration while Gtk->events_pending; - $tag2 = Gtk->timeout_add(1000, sub { system( $isconnected2 ? "/etc/sysconfig/network-scripts/net_cnx_down &" : "/etc/sysconfig/network-scripts/net_cnx_up &"); 0; }); -} - -sub rescan { - get_val(); - foreach(@interfaces) { - my $intf = $_; - my $recv = $monitor->{$intf}{val}->[0]; - my $transmit = $monitor->{$intf}{val}->[8]; - my $refr = $monitor->{$intf}{referencer}; - my $reft = $monitor->{$intf}{referencet}; - $monitor->{sr} += $recv - $refr; - $monitor->{st} += $transmit - $reft; - - $monitor->{$intf}{recva} += $recv - $refr; - $monitor->{$intf}{recvan}++; - if ($monitor->{$intf}{recvan} > 9) { - push(@{$monitor->{$intf}{stack_ra}}, $monitor->{$intf}{recva}/10); - $monitor->{$intf}{recva} = $monitor->{$intf}{recvan} = 0; - } else { push(@{$monitor->{$intf}{stack_ra}}, -1) } - shift @{$monitor->{$intf}{stack_ra}} if @{$monitor->{$intf}{stack_ra}} > 250; - - push(@{$monitor->{$intf}{stack_r}}, $recv - $refr); - shift @{$monitor->{$intf}{stack_r}} if @{$monitor->{$intf}{stack_r}} > 250; - $labelr->set(formatXiB($recv - $monitor->{$intf}{initialr})); - $monitor->{$intf}{referencer} = $recv; - - $monitor->{$intf}{transmita} += $transmit - $reft; - $monitor->{$intf}{transmitan}++; - if ($monitor->{$intf}{transmitan} > 9) { - push(@{$monitor->{$intf}{stack_ta}}, $monitor->{$intf}{transmita}/10); - $monitor->{$intf}{transmita} = $monitor->{$intf}{transmitan} = 0; - } else { push(@{$monitor->{$intf}{stack_ta}}, -1) } - shift @{$monitor->{$intf}{stack_ta}} if @{$monitor->{$intf}{stack_ta}} > 250; - - push(@{$monitor->{$intf}{stack_t}}, $transmit - $reft); - shift @{$monitor->{$intf}{stack_t}} if @{$monitor->{$intf}{stack_t}} > 250; - $labelt->set(formatXiB($transmit - $monitor->{$intf}{initialt})); - $monitor->{$intf}{referencet} = $transmit; - - draw_monitor($monitor->{$intf}); - } - $label_sr->set(formatXiB($monitor->{sr}) . "/s"); - $label_st->set(formatXiB($monitor->{st}) . "/s"); - $monitor->{sra} += $monitor->{sr}; - $monitor->{sta} += $monitor->{st}; - $monitor->{nba} ++; - if($monitor->{nba} > 9) { - $label_sra->set(formatXiB($monitor->{sra}/10) . "/s"); - $label_sta->set(formatXiB($monitor->{sta}/10) . "/s"); - $monitor->{sra} = 0; - $monitor->{sta} = 0; - $monitor->{nba} = 0; - } - $label_cnx_type->set($netcnx->{type}); - $monitor->{$_} = 0 foreach ('sr', 'st'); - 1; -} - -sub get_val { - my @ret; - my $a = cat_("/proc/net/dev"); - $a =~ s/^.*?\n.*?\n//; - $a =~ s/^\s*lo:.*?\n//; - my @line = split(/\n/, $a); - foreach(@line) { - s/\s*(\w*)://; - my $intf=$1; - push (@ret,$intf); - $monitor->{$intf}{val} = [split()]; - $monitor->{$intf}{intf} = $intf; - } - @ret; -} - -sub update { - my @intfs = get_val(); - if($combo1->entry->get_text ne ($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default")) { - $combo1->entry->set_text($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default"); - } - foreach(@intfs) { - my $intf = $_; - if(!member($intf,@interfaces)) { - $default_intf = $intf; - $monitor->{$intf}{initialr} = $monitor->{$intf}{val}->[0]; - $monitor->{$intf}{initialt} = $monitor->{$intf}{val}->[8]; - $notebook->append_page(gtkshow(my $page = gtkpack_(new Gtk::VBox(0,0), - 0, gtkpack__(gtkset_border_width(new Gtk::HBox(0,0), 5), - gtksize(my $darea = $monitor->{$intf}{darea} = new Gtk::DrawingArea(),300, 150)), - 0, gtkpack__(gtkset_border_width(new Gtk::HBox(0,5), 5), - gtksize(my $dareat = new Gtk::DrawingArea(),15, 15), - _("sent: "), $labelt = new Gtk::Label("0")), - 0, gtkpack__(gtkset_border_width(new Gtk::HBox(0,5), 5), - gtksize(my $darear = new Gtk::DrawingArea(),15, 15), - _("received: "), $labelr = new Gtk::Label("0")), - )), - new Gtk::Label($intf)); - $dareat->signal_connect( expose_event => sub { - $dareat->window->draw_rectangle ($gct, 1, 0, 0, 15, 15); - }); - $darear->signal_connect( expose_event => sub { - $darear->window->draw_rectangle ($gcr, 1, 0, 0, 15, 15); - }); - $notebook->set_page($notebook->page_num($page)); - $monitor->{$intf}{page}=($notebook->page_num($page)); - $monitor->{$intf}{pixmap_db} = new Gtk::Gdk::Pixmap($darea->window, 300, 150); - $monitor->{$intf}{referencer} = $monitor->{$intf}{val}->[0]; - $monitor->{$intf}{referencet} = $monitor->{$intf}{val}->[8]; - $monitor->{$intf}{pixmap_db}->draw_rectangle ($monitor->{$intf}{darea}->style->black_gc, 1, 0, 0, 300, 150); - $darea->signal_connect( expose_event => sub { - $darea->window->draw_pixmap ($darea->style->bg_gc('normal'), - $monitor->{$intf}{pixmap_db}, 0, 0, 0, 0, 300, 150); - }); - } - } - foreach(@interfaces) { - my $intf = $_; - if(!member($intf,@intfs)) { - $notebook->remove_page($monitor->{$intf}{page}); - } - } - @interfaces = @intfs; - my $netc={}; - if(network::netconnect::connected('', $netc) == !$isconnected) { - $isconnected = $isconnected ? 0 : 1; - $label_c->set($isconnected ? _("Disconnect") : _("Connect")); - $statusbar->pop(1); - $statusbar->push(1, network::netconnect::connected('', $netc) ? _("Connected") : _("Not connected")); - $isconnected ? $pix_c->set($pix_c_map, $pix_c_mask) : $pix_c->set($pix_d_map, $pix_d_mask); - } - $time_tag2 = Gtk->timeout_add(5000, \&update); - 0; -} - -sub draw_monitor { - my ($o) = @_; - defined $o->{darea} or return; - $o->{pixmap_db}->draw_rectangle ($o->{darea}->style->black_gc, 1, 0, 0, 300, 150); - my $maxr = 0; - foreach (@{$o->{stack_r}}) { $maxr = $_ if $_>$maxr } - my $maxt = 0; - foreach (@{$o->{stack_t}}) { $maxt = $_ if $_>$maxt } - my $ech = $maxr + $maxt; - $ech == 0 and $ech = 1; - my $step=50; - foreach (@{$o->{stack_t}}) { - $o->{pixmap_db}->draw_rectangle($gct, 1, $step, 0, 1, $_*150/$ech); - $step++; - } - $step=50; - my ($av1, $av2, $last_a); - foreach (@{$o->{stack_ta}}) { - if($_ != -1) { - if( !defined $av1) { $av1 = $_ } else { defined $av2 or $av2 = $_ } - if ($av1 && $av2) { - $o->{pixmap_db}->draw_line($gca, $step-10, $av1*150/$ech, $step, $av2*150/$ech); - $av1 = $av2; - undef $av2; - $last_a = $step-50; - } - } - $step++; - } - $step=50; - foreach (@{$o->{stack_r}}) { - $o->{pixmap_db}->draw_rectangle($gcr, 1, $step, 151-$_*150/$ech, 1, $_*150/$ech); - $step++; - } - $step=50; - ($av1, $av2) = undef; - foreach (@{$o->{stack_ra}}) { - if($_ != -1) { - if(!defined $av1) { $av1 = $_ } else { defined $av2 or $av2 = $_ } - if ((defined $av1) && (defined $av2)) { - $o->{pixmap_db}->draw_line($gca, $step-10, 151-$av1*150/$ech, $step, 151-$av2*150/$ech); - $av1 = $av2; - undef $av2; - } - } - $step++; - } - - my $gcl = new Gtk::Gdk::GC($o->{darea}->window); - $gcl->set_foreground($o->{darea}->window->get_colormap->color_white()); - $gcl->set_line_attributes (1, 'on-off-dash', 'not-last', 'round'); - my $style= new Gtk::Style; - $style->font(Gtk::Gdk::Font->fontset_load("-adobe-times-medium-r-normal-*-12-*-75-75-p-*-iso8859-*,*-r-*")); - for (my $i = 30;$i<=120;$i+=30) { - $o->{pixmap_db}->draw_line($gcl, 50, $i, 300, $i); - my ($gc2, $text); - my ($dif1, $dif2); - if ($last_a) { - $dif1 = abs(150-@{$o->{stack_ra}}[$last_a]*150/$ech - $i); - $dif2 = abs(@{$o->{stack_ta}}[$last_a]*150/$ech - $i); - } else { - $dif1 = abs(150-@{$o->{stack_r}}[@{$o->{stack_r}}-1]*150/$ech - $i); - $dif2 = abs(@{$o->{stack_t}}[@{$o->{stack_t}}-1]*150/$ech - $i); - } - if ($dif1 < $dif2) { - $text = formatXiB((150-$i)*$ech/150); - $gc2=$gcr; - } else { - $text = formatXiB($i*$ech/150); - $gc2=$gct; - } -# $text = formatXiB((150-$i)*$ech/150); -# $gc2 = $o->{darea}->style->white_gc; - - my $w = $style->font->string_width($text); - $o->{pixmap_db}->draw_string($style->font, $gc2, 45-$w, $i+5, ($text) ); - } - $o->{darea}->draw(undef); -} diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake deleted file mode 100755 index 5f9277f12..000000000 --- a/perl-install/standalone/printerdrake +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/perl - -# printerdrake -# Copyright (C) 1999 MandrakeSoft (fpons@mandrakesoft.com) -# Original version for printer configuration from pad. -# -# 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. - -use lib qw(/usr/lib/libDrakX); - -use interactive; -use standalone; -use printerdrake; -use printer; -use c; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -local $_ = join '', @ARGV; - -/-h/ and die "usage: printerdrake [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; - -$::beginner = /-beginner/; -$::expert = /-expert/; -$::auto = /-auto/; -$::noauto = /-noauto/; -$::skiptest = /-skiptest/; -$::testing = /-testing/; - -my $printer; -# Get what was installed before -eval { $printer = printer::getinfo('') }; -# Choose the spooler by command line options -/-cups/ and - $printer->{mode} = 'cups' and printer::read_configured_queues($printer); -/-lpr/ and - $printer->{mode} = 'lpd' and printer::read_configured_queues($printer); -/-lpd/ and - $printer->{mode} = 'lpd' and printer::read_configured_queues($printer); -/-lprng/ and - $printer->{mode} = 'lprng' and printer::read_configured_queues($printer); -/-pdq/ and - $printer->{mode} = 'pdq' and printer::read_configured_queues($printer); - -my $in = vnew interactive('printer', 'su'); - --r '/etc/modules.conf' and modules::mergein_conf('/etc/modules.conf'); - -begin: -$::isEmbedded and kill USR2, $::CCPID; -printerdrake::main($printer, $in, 1, sub { $in->standalone::pkgs_install(@_) }); - -$::isEmbedded ? kill(USR1, $::CCPID) : $in->exit(0); -goto begin; diff --git a/perl-install/standalone/tinyfirewall b/perl-install/standalone/tinyfirewall deleted file mode 100755 index a9aeb1f5a..000000000 --- a/perl-install/standalone/tinyfirewall +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/perl - -# DrakNet - -# Copyright (C) 1999 MandrakeSoft (damien@mandrakesoft.com) -# -# 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. - -use lib qw(/usr/lib/libDrakX); -use interactive; -use standalone; -use tinyfirewall; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; -$::isWizard = "@ARGV" =~ /--wizard/; -$::Wizard_pix_up = "wiz_firewall.png"; -$::Wizard_title = _("Firewalling Configuration"); - -local $_ = join '', @ARGV; - -my $in = vnew interactive('su'); - -$::isEmbedded && ref($in) =~ /gtk/ or goto dd; -require Gtk; -init Gtk; - -my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; -$window1->signal_connect ( delete_event => sub { Gtk->exit(0); }); -$window1->set_position(1); -$window1->set_title(_("Firewalling configuration")); -$window1->border_width(10); -$::isEmbedded or $window1->set_usize(500, 400); -my $vbox1 = new Gtk::VBox(0,0); -$window1->add($vbox1); -my $hbox1 = new Gtk::HBox(0,0); -$vbox1->pack_start($hbox1,1,1,0); -my $label1 = new Gtk::Label(""); -$hbox1->pack_start($label1,1,1,0); -my $hbox2 = new Gtk::HBox(0,0); -$vbox1->pack_start($hbox2,1,1,0); - -my $bbox1 = new Gtk::HButtonBox; -$vbox1->pack_start($bbox1,0,0,0); -$bbox1->set_layout(-end); -my $button_conf = new Gtk::Button _("Configure"); -$button_conf->signal_connect ( clicked => sub { - system("/usr/sbin/tinyfirewall --wizard"); - update(); - }); -$bbox1->add($button_conf); -my $button_ok = new Gtk::Button _("Cancel"); -$button_ok->signal_connect ( clicked => sub { - quit_global(); - }); -$bbox1->add($button_ok); -$window1->show_all(); -update(); -Gtk->main_iteration while Gtk->events_pending; -$::isEmbedded and kill USR2, $::CCPID; -Gtk->main; -Gtk->exit(0); - -sub update { -$label1->set(-e "/etc/rc.d/rc3.d/S05bastille-firewall" ? - _("Firewalling - -You already have set up a firewall. -Click on Configure to change or remove the firewall"): - _("Firewalling - -Click on Configure to set up a standard firewall")); -} - -sub quit_global { - $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0); -} - -dd: -tinyfirewall::main($in); |