3 # A perl script that will replace the line in /etc/fstab
4 # corresponding to the device given by the first argument,
5 # with a new line mounting that device to the second
6 # argument, or add it if necessary.
8 # openafs-tools, Version 1.2.2
10 # Copyright 2001, International Business Machines Corporation and others.
11 # All Rights Reserved.
13 # This software has been released under the terms of the IBM Public
14 # License. For details, see the LICENSE file in the top-level source
15 # directory or online at http://www.openafs.org/dl/license10.html
18 open( FSTAB, "</etc/fstab");
22 open( FSTAB, ">/etc/fstab");
26 foreach $line (@fstab) {
27 @splitline = split(/\s+/, $line);
28 if( $splitline[0] eq "/dev/$ARGV[0]" ) {
29 print FSTAB "/dev/$ARGV[0]\t\t$ARGV[1]\t\t\text2\tdefaults 0 2\n";
36 if( $replaced == 0 ) {
37 print FSTAB "/dev/$ARGV[0]\t\t$ARGV[1]\t\t\text2\tdefaults 0 2\n";