From 1ea920072c09c49c019188e7d30b7fca1e6e8391 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Wed, 5 Mar 2008 16:34:38 +0000 Subject: remove and don't install disabled wizards so that mcc doesn't offer to run them --- nfs_wizard/.perl_checker | 1 - nfs_wizard/Makefile | 13 -- nfs_wizard/NFS.pm | 166 ----------------------- nfs_wizard/images/IC-NFS-48.png | Bin 2643 -> 0 bytes nfs_wizard/nfs.wiz | 291 ---------------------------------------- nfs_wizard/scripts/NFSConf.pm | 67 --------- nfs_wizard/scripts/do_it_nfs.sh | 52 ------- 7 files changed, 590 deletions(-) delete mode 100644 nfs_wizard/.perl_checker delete mode 100644 nfs_wizard/Makefile delete mode 100755 nfs_wizard/NFS.pm delete mode 100644 nfs_wizard/images/IC-NFS-48.png delete mode 100644 nfs_wizard/nfs.wiz delete mode 100644 nfs_wizard/scripts/NFSConf.pm delete mode 100755 nfs_wizard/scripts/do_it_nfs.sh (limited to 'nfs_wizard') diff --git a/nfs_wizard/.perl_checker b/nfs_wizard/.perl_checker deleted file mode 100644 index 725f44b4..00000000 --- a/nfs_wizard/.perl_checker +++ /dev/null @@ -1 +0,0 @@ -Basedir .. \ No newline at end of file diff --git a/nfs_wizard/Makefile b/nfs_wizard/Makefile deleted file mode 100644 index 7b0d0866..00000000 --- a/nfs_wizard/Makefile +++ /dev/null @@ -1,13 +0,0 @@ - -install2: - su -c 'make install' - -install: - mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards - mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/nfs_wizard - mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/nfs_wizard/scripts - mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/nfs_wizard/images - install --mode=u=rwx,g=rx,o=rx -p nfs.wiz ${prefix}/share/wizards/nfs_wizard - install --mode=a=r -p images/IC-NFS-48.png ${prefix}/share/wizards/nfs_wizard/images - install --mode=u=rwx,g=rx,o=rx -p scripts/*.sh ${prefix}/share/wizards/nfs_wizard/scripts - install --mode=u=rw,g=r,o=r -p scripts/NFSConf.pm ${prefix}/share/wizards/nfs_wizard/scripts diff --git a/nfs_wizard/NFS.pm b/nfs_wizard/NFS.pm deleted file mode 100755 index eedf6259..00000000 --- a/nfs_wizard/NFS.pm +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/perl - -# Drakwizard - -# Copyright (C) 2002,2003 Mandrakesoft -# -# Authors: Arnaud Desmons -# Florent Villard -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -package MDK::Wizard::NFS; -use strict; - -use common; -use services; -use MDK::Wizard::Wizcommon; - -my $wiz = new MDK::Wizard::Wizcommon; -my $in = interactive->vnew; - -my $o = { - name => N("NFS Wizard"), - var => { - wiz_nfs_dir => '', - wiz_nfs_level => '', - wiz_netmask => '' - }, - needed_rpm => [ 'nfs-utils' ], - defaultimage => "/usr/share/mcc/themes/default/nfs_server-mdk.png", - }; - -my %level = ( - 1 => N("All - No access restriction"), - 2 => N("Local Network - access for local network (recommended)") -); - -$o->{pages} = { - welcome => { - name => N("NFS Server Configuration Wizard") . "\n\n" . N("This wizard will help you configuring the NFS server for your network."), - no_back => 1, - pre => sub { - $in->ask_warn((""), N("You should now use draknfs to configure your NFS share.")) or $in->exit; - }, - next => 'nfs' - }, - nfs => { - name => N("NFS server") . "\n\n" .N("Directory which will be exported to NFS clients. This directory will be exported in read only mode. It denies any request which requires changes to the filesystem."), - data => [ - { label => N("Directory:"), val => \$o->{var}{wiz_nfs_dir} }, - { label => N("Create directory if it doesn't exist"), type => 'bool', val => \$o->{var}{create_missing_directory} }, - ], - complete => sub { - if (!-d $o->{var}{wiz_nfs_dir} and $o->{var}{create_missing_directory}) { - mkdir_p($o->{var}{wiz_nfs_dir}); - } elsif (!-d $o->{var}{wiz_nfs_dir}) { - $in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually.")); - return 1; } - }, - next => 'ask_level' - }, - ask_level => { - name => N("Access control") . "\n\n" . N("NFS can be restricted to a certain ip class") . "\n\n" . N("Choose the level that suits your needs. If you don't know, the local network level is usually the most appropriate. Beware that the all level may be not secure."), - pre => sub { - $o->{var}{wiz_netmask} = network_mask() if !$o->{var}{wiz_netmask} || $o->{var}{wiz_netmask} eq '0.0.0.0/0.0.0.0' - }, - data => [ - { val => \$o->{var}{wiz_nfs_level}, list => [ keys %level ], format => sub { $level{$_[0]} } }, - ], - post => \&chooser, - next => 'summary' - }, - shownet => { - name => N("Grant access on local network") . "\n\n" . N("Access will be allowed for hosts on the network. Here is the information found about your current local network, you can modify it if needed."), - data => [ - { label => N("Authorized network:"), val => \$o->{var}{wiz_netmask} }, - ], - next => 'summary' - - }, - summary => { - name => N("The wizard collected the following parameters."), - pre => sub { - $o->{var}{wiz_text_level} = $level{$o->{var}{wiz_nfs_level}}; - $o->{var}{wiz_netmask} = $o->{var}{wiz_nfs_level} == 1 ? "0.0.0.0/0.0.0.0" : $o->{var}{wiz_netmask} - }, - data => [ - { label => N("Exported dir:"), val_ref => \$o->{var}{wiz_nfs_dir} }, - { label => N("Access:"), val_ref => \$o->{var}{wiz_text_level} }, - { label => N("Netmask:"), val_ref => \$o->{var}{wiz_netmask} }, - ], - post => \&do_it, - next => 'end' - }, - end => { - name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your NFS server."), - end => 1, - next => 0 - }, - error_end => { - name => N("Failed"), - data => [ { label => N("Relaunch drakwizard, and try to change some parameters.") } ], - no_back => 1, - end => 1, - next => 0, - }, - - }; - -sub new { - my ($class) = @_; - bless $o, $class; -} - -sub network_mask { - my $wiz_ip_server = $wiz->{net}->itf_get("IPADDR"); - my $mask = $wiz->{net}->itf_get("NETMASK"); - $mask = $mask || "255.255.255.0"; - $wiz_ip_server = $wiz_ip_server || "192.168.1.0"; - "$1.$2.$3.0/$mask" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; -} - -sub chooser { - $o->{var}{wiz_nfs_level} == 2 || 'shownet' -} - -sub do_it { - $::testing and return; - my $line; - my $file = "/etc/exports"; - chomp($o->{var}{wiz_nfs_dir}); - -f $file and cp_af($file, $file.".orig"); - if ($o->{var}{wiz_nfs_level} == 2) { - #my $mask = $wiz->{net}->itf_get("NETMASK"); - $line = "$o->{var}{wiz_nfs_dir} $o->{var}{wiz_netmask}(ro,no_root_squash,sync)\n"; - } - else { - $line = "$o->{var}{wiz_nfs_dir} *(rw,no_root_squash,sync)\n"; - } - my $t; - foreach (cat_($file)) { - if (/^(?!#).*$o->{var}{wiz_nfs_dir}\s/) { - $t = $_; - last; - } - } - substInFile { s|^(?!#).*$o->{var}{wiz_nfs_dir}\s.*|#$&| } $file; - append_to_file($file, $line); - system("/usr/sbin/exportfs -a"); - services::start('nfs') if services::is_service_running('nfs'); - check_started('nfsd'); -} - -1; diff --git a/nfs_wizard/images/IC-NFS-48.png b/nfs_wizard/images/IC-NFS-48.png deleted file mode 100644 index 56f53d5e..00000000 Binary files a/nfs_wizard/images/IC-NFS-48.png and /dev/null differ diff --git a/nfs_wizard/nfs.wiz b/nfs_wizard/nfs.wiz deleted file mode 100644 index 6781d47c..00000000 --- a/nfs_wizard/nfs.wiz +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nfs_wizard/scripts/NFSConf.pm b/nfs_wizard/scripts/NFSConf.pm deleted file mode 100644 index 580aa9ef..00000000 --- a/nfs_wizard/scripts/NFSConf.pm +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl - -# Drakwizard - -# Copyright (C) 2002 MandrakeSoft Arnaud Desmons (adesmons@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. - -package NFSConf; -use lib "/usr/lib/libDrakX"; -require "__WIZ_HOME__/common/scripts/Vareqval.pm"; -require "__WIZ_HOME__/common/scripts/IFCFG.pm"; -use MDK::Common; -use services; -use strict; - -my $o = IFCFG->new(); - -sub network_mask { - my $wiz_ip_server = $o->itf_get("IPADDR"); - my $mask = $o->itf_get("NETMASK"); - $mask = $mask ? $mask : "255.255.255.0"; - $wiz_ip_server = $wiz_ip_server ? $wiz_ip_server : "192.168.1.0"; - "$1.$2.$3.0/$mask" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; -} - -sub chooser { - $ENV{wiz_nfs_level}; -} - -sub do_it { - my $line; - my $file = "/etc/exports"; - chomp($ENV{wiz_nfs_dir}); - -f $file and cp_af($file, $file.".orig"); - if ($ENV{wiz_nfs_level} == 2) { - my $mask = $o->itf_get("NETMASK"); - $line = "$ENV{wiz_nfs_dir} $ENV{wiz_netmask}(rw,no_root_squash)\n"; - } - else { - $line = "$ENV{wiz_nfs_dir} *(rw,no_root_squash)\n"; - } - my $t; - foreach (cat_($file)) { - if (/^(?!\#).*$ENV{wiz_nfs_dir}\s.*/) { - $t = $_; - last; - } - } - substInFile { s|^(?!\#).*$ENV{wiz_nfs_dir}\s.*|\#$&|} $file; - append_to_file($file, $line); - system("/usr/sbin/exportfs -a"); - services::is_service_running('nfs') and services::start('nfs'); - 10 -} diff --git a/nfs_wizard/scripts/do_it_nfs.sh b/nfs_wizard/scripts/do_it_nfs.sh deleted file mode 100755 index 917d838d..00000000 --- a/nfs_wizard/scripts/do_it_nfs.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# Wizard -# -# Copyright (C) 2000 Mandrakesoft. -# -# 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 -# of the License, or (at your option) any later version. -# See file LICENSE for further informations on licensing terms. -# -# 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. -# -# Authors: Philippe Vivien, Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi -# http://www.mandrakesoft.com - -# script for wizard nfs configuration -# -# modify default nfs configuration -# assuming all dependencies are ok -# -# WARNING : just using /etc/exports for nfs configuration, assuming -# other files are close to standard configuration - -nfs_file="/etc/exports" - -echo "${wiz_nfs_dir} ${wiz_ip_net} ${wiz_ip_netmask}" -echo "wiz_ip_net:${wiz_ip_net}" >t.log -echo "wiz_ip_netmask:${wiz_ip_netmask}" >>t.log - -echo "dir:${wiz_nfs_dir}" >>t.log -echo "clt:${wiz_ip_net}/${wiz_ip_netmask}" >>t.log - -echo "export :\n">>t.log -echo "${wiz_nfs_dir} ${wiz_ip_net}/${wiz_ip_netmask}(rw,no_root_squash)" >> t.log -echo "${wiz_nfs_dir} ${wiz_ip_net}/${wiz_ip_netmask}(rw,no_root_squash)" > ${nfs_file} - -/usr/sbin/exportfs -a - -# all is ok -exit 10 - - - -- cgit v1.2.1