From ccfcc4622733b446d103146acb704ab73fbfbfe4 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Mon, 22 May 2006 12:11:05 +0000 Subject: Add NFS shares information --- hardinfo2/arch/linux/common/nfs.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 hardinfo2/arch/linux/common/nfs.h (limited to 'hardinfo2/arch/linux/common/nfs.h') diff --git a/hardinfo2/arch/linux/common/nfs.h b/hardinfo2/arch/linux/common/nfs.h new file mode 100644 index 00000000..675bc851 --- /dev/null +++ b/hardinfo2/arch/linux/common/nfs.h @@ -0,0 +1,26 @@ +static gchar *nfs_shares_list = NULL; +void +scan_nfs_shared_directories(void) +{ + FILE *exports; + gchar buf[512]; + + if (nfs_shares_list) { + g_free(nfs_shares_list); + } + + nfs_shares_list = g_strdup(""); + + exports = fopen("/etc/exports", "r"); + while (fgets(buf, 512, exports)) { + if (buf[0] != '/') + continue; + + strend(buf, ' '); + strend(buf, '\t'); + + nfs_shares_list = g_strconcat(nfs_shares_list, buf, "=\n", NULL); + } + fclose(exports); +} + -- cgit v1.2.3