summaryrefslogtreecommitdiffstats
path: root/nfs_wizard
diff options
context:
space:
mode:
Diffstat (limited to 'nfs_wizard')
-rw-r--r--nfs_wizard/Makefile18
-rw-r--r--nfs_wizard/images/NFS.pngbin0 -> 14505 bytes
-rw-r--r--nfs_wizard/nfs.wiz216
-rw-r--r--nfs_wizard/scripts/NFSConf.pm27
4 files changed, 261 insertions, 0 deletions
diff --git a/nfs_wizard/Makefile b/nfs_wizard/Makefile
new file mode 100644
index 00000000..ac203cc7
--- /dev/null
+++ b/nfs_wizard/Makefile
@@ -0,0 +1,18 @@
+
+install2:
+ su -c 'make install'
+
+install:
+ mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/usr/share/wizards
+ mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/usr/share/wizards/nfs_wizard
+ mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/usr/share/wizards/nfs_wizard/scripts
+ mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/usr/share/wizards/nfs_wizard/images
+ install --mode=u=rwx,g=rx,o=rx -p nfs.wiz ${prefix}/usr/share/wizards/nfs_wizard
+ install --mode=u=rwx,g=rx,o=rx -p nfs.en.wpo ${prefix}/usr/share/wizards/nfs_wizard
+ install --mode=u=rwx,g=rx,o=rx -p nfs.fr.wpo ${prefix}/usr/share/wizards/nfs_wizard
+ install --mode=u=rwx,g=rx,o=rx -p nfs.de.wpo ${prefix}/usr/share/wizards/nfs_wizard
+ install --mode=u=rwx,g=rx,o=rx -p nfs.es.wpo ${prefix}/usr/share/wizards/nfs_wizard
+ install --mode=u=rwx,g=rx,o=rx -p nfs.it.wpo ${prefix}/usr/share/wizards/nfs_wizard
+ install --mode=a=r -p ./images/NFS.jpg ${prefix}/usr/share/wizards/nfs_wizard/images
+ install --mode=u=rwx,g=rx,o=rx -p scripts/*.sh ${prefix}/usr/share/wizards/nfs_wizard/scripts
+
diff --git a/nfs_wizard/images/NFS.png b/nfs_wizard/images/NFS.png
new file mode 100644
index 00000000..945b63e8
--- /dev/null
+++ b/nfs_wizard/images/NFS.png
Binary files differ
diff --git a/nfs_wizard/nfs.wiz b/nfs_wizard/nfs.wiz
new file mode 100644
index 00000000..ae4bf2d8
--- /dev/null
+++ b/nfs_wizard/nfs.wiz
@@ -0,0 +1,216 @@
+<?xml version="1.0"?>
+
+
+<Wizard
+ name="general"
+ libScript="__WIZ_HOME__/common/scripts/functions.sh"
+ wizardTitle="NFS Wizard"
+ imagePosition="top"
+ defaultImage="__WIZ_HOME__/nfs_wizard/images/NFS"
+ perlModule="__WIZ_HOME__/nfs_wizard/scripts/NFSConf.pm"
+ rpm="nfs-utils"
+>
+
+ <Variable
+ name="varwiz_nfs_dir"
+ shellVariable="wiz_nfs_dir"
+ defaultValue="/home/public"
+ persistent="false"
+ >
+ </Variable>
+
+ <Page
+ helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-nfs.html"
+ name="welcome"
+ jumpPage="nfs connections"
+ executionLevel="NORMAL"
+ nextFinish="false"
+ canBack="true"
+ canCancel="true"
+ >
+ <Info
+ name="info1"
+ alignement="Center"
+ helpText="NFS Server Configuration Wizard"
+ guiType="label"
+ fontName="Default"
+ fontStyle="bold"
+ fontSize="14"
+ >
+ </Info>
+
+ <Info
+ name="info2"
+ alignement="Center"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+
+ <Info
+ name="info3"
+ alignement="Center"
+ helpText="This wizard will help you configuring"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+
+ <Info
+ name="info4"
+ alignement="Center"
+ helpText="the NFS Server for your network."
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+ </Page>
+
+ <Page
+ helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-nfs.html"
+ name="nfs connections"
+ func="do_it"
+ jumpPage="congratulations"
+ executionLevel="NORMAL"
+ nextFinish="false"
+ canBack="true"
+ canCancel="true"
+ >
+
+ <Info
+ name="nfs Title"
+ alignement="Center"
+ helpText="NFS Server"
+ guiType="label"
+ fontName="Default"
+ fontStyle="bold"
+ fontSize="14"
+ >
+ </Info>
+
+ <Info
+ name="info27"
+ alignement="Center"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+
+ <TDline
+ name="line1"
+ >
+ </TDline>
+
+ <Info
+ name="info30"
+ alignement="Center"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+
+ <Freetext
+ variableName="varwiz_nfs_dir"
+ alignement="Fill"
+ helpText="Directory:"
+ guiType="textfield"
+ editable="true"
+ fontName="Default"
+ fontStyle="bold"
+ fontSize="14"
+ proportional="2"
+ ratio="30"
+ length="40"
+ >
+ </Freetext>
+
+ <Info
+ name="info31"
+ alignement="Center"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+
+ <TDline
+ name="line"
+ >
+ </TDline>
+
+ <Info
+ name="info33"
+ alignement="Center"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+ </Page>
+
+ <Page
+ helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-nfs.html"
+ name="congratulations"
+ nextButtonText="Quit"
+ executionLevel="NORMAL"
+ nextFinish="true"
+ canBack="false"
+ canCancel="false"
+ >
+
+ <Info
+ name="info23"
+ alignement="Center"
+ helpText="Congratulations"
+ guiType="label"
+ fontName="Default"
+ fontStyle="bold"
+ fontSize="14"
+ >
+ </Info>
+
+ <Info
+ name="info20"
+ alignement="Center"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+
+ <Info
+ name="info24"
+ alignement="Center"
+ helpText="The wizard succesfully configured your"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+
+ <Info
+ name="info25"
+ alignement="Center"
+ helpText="NFS Server"
+ guiType="label"
+ fontName="Default"
+ fontStyle="plain"
+ fontSize="11"
+ >
+ </Info>
+ </Page>
+</Wizard>
diff --git a/nfs_wizard/scripts/NFSConf.pm b/nfs_wizard/scripts/NFSConf.pm
new file mode 100644
index 00000000..942380d9
--- /dev/null
+++ b/nfs_wizard/scripts/NFSConf.pm
@@ -0,0 +1,27 @@
+#! /usr/bin/perl -w
+
+package NFSConf;
+require "__WIZ_HOME__/common/scripts/Vareqval.pm";
+require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
+use MDK::Common;
+use strict;
+
+my $o = DrakconnectConf->new();
+
+sub do_it {
+ my $file = "/etc/exports";
+ my $ip = "$1.$2.$3.0" if $o->get_from_known_dev("IP") =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
+ my $mask = $o->get_from_known_dev("Mask");
+ my $line = "$ENV{wiz_nfs_dir} $ip/$mask(rw,no_root_squash)\n";
+ my $t;
+
+ foreach (cat_($file)) {
+ if (/^\s*(?!\#)\s*\$ENV{wiz_nfs_dir}.*/) {
+ $t = $_;
+ last;
+ }
+ }
+ if ($t) { substInFile { s|$t|\#$&$line|} $file }
+ else { append_to_file($file, $line) }
+ system("/usr/sbin/exportfs -a")
+}