Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...
|
[SSI] openssi/openssi-tools/sysadmin ssi-utils.pm,1.3,1.4: msg#00268
|
Subject: |
[SSI] openssi/openssi-tools/sysadmin ssi-utils.pm,1.3,1.4 |
Update of /cvsroot/ssic-linux/openssi/openssi-tools/sysadmin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8859/sysadmin
Modified Files:
Tag: OPENSSI-DEBIAN
ssi-utils.pm
Log Message:
Add fstab parsing APIs to utils and use them in ssi_distro.pm for debian
Index: ssi-utils.pm
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/openssi-tools/sysadmin/ssi-utils.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ssi-utils.pm 14 Jan 2004 02:59:53 -0000 1.3
--- ssi-utils.pm 29 Jan 2004 22:59:18 -0000 1.4
***************
*** 2,5 ****
--- 2,6 ----
# Date : Jan 13 2004
# Authors: Brian Watson <Brian.J.Watson@xxxxxx>
+ # Authors: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxx>
#
# This program is free software; you can redistribute it and/or
***************
*** 48,51 ****
--- 49,55 ----
make_invstring
make_ipstring
+
+ get_fstabentry
+ is_mountpoint
);
}
***************
*** 118,120 ****
--- 122,160 ----
}
+ sub get_fstabentry {
+ my $fstab_name = shift;
+ my $dirname = shift;
+ my $input_line;
+ my @line_entry;
+
+ open FSTAB, "< $fstab_name" or die;
+ while (! eof(FSTAB)) {
+
+ $input_line = <FSTAB>;
+ @line_entry = split(/[\t ]+/ ,$input_line);
+
+ if ( $line_entry[0] =~ /^#/ ) {
+ #Neglect the line that starts with #
+ next;
+ }
+
+ if ( $line_entry[1] =~ /^$dirname$/ ) {
+ close FSTAB;
+ return @line_entry
+ } else {
+ next;
+ }
+ }
+ close FSTAB;
+ return;
+
+ }
+
+ sub is_mountpoint {
+ my $dirname = shift;
+ my ($rootdev, $type, $opts) = get_fstabentry("/etc/fstab", $dirname);
+
+ return 0 unless $rootdev;
+ return 1;
+ }
1;
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
|
| |