#!/usr/bin/perl

# 
# Opservices Tecnologia da Informacao
#
# Version 1.0
# Returns the valid disks and mount points 
# on linux system, excluding tmpfs and nfs
# file system types.
#
#

use strict;

# define the command paths
our $df = `which df`;
chomp $df;
our $grep = `which grep`;
chomp $grep;

sub main() {

	# get the filesystems( l - localfilesystems, 
	# P - Posix compatibility, -T get the fs type )
	my @dret = `$df -lPT -x tmpfs -x nfs |$grep -v ilesystem`;
	chomp( @dret );

	my $message;
	foreach( @dret ) {
		my @splarr = split( /[ ]+/ );
		$message .= $splarr[$#splarr]."[".$splarr[0] ." - ".$splarr[1] ."] ";
	}

	print "$message\n";;
	exit(0);
}

&main();
