diff options
Diffstat (limited to 'hardinfo2/arch/linux/common/nfs.h')
-rw-r--r-- | hardinfo2/arch/linux/common/nfs.h | 26 |
1 files changed, 26 insertions, 0 deletions
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); +} + |