summaryrefslogtreecommitdiffstats
path: root/nfs_wizard/scripts
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-08-30 14:36:37 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-08-30 14:36:37 +0000
commit45a700d5dbf0400231c5de8b99e3988251507274 (patch)
tree0897bdce118d4d80282159c24bcda3be58685409 /nfs_wizard/scripts
parent4f2cff7e07cfddb99e0562e0e1f8eae1914ef16e (diff)
downloaddrakwizard-45a700d5dbf0400231c5de8b99e3988251507274.tar
drakwizard-45a700d5dbf0400231c5de8b99e3988251507274.tar.gz
drakwizard-45a700d5dbf0400231c5de8b99e3988251507274.tar.bz2
drakwizard-45a700d5dbf0400231c5de8b99e3988251507274.tar.xz
drakwizard-45a700d5dbf0400231c5de8b99e3988251507274.zip
first release
Diffstat (limited to 'nfs_wizard/scripts')
-rw-r--r--nfs_wizard/scripts/NFSConf.pm27
1 files changed, 27 insertions, 0 deletions
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")
+}