File: showdisk.pl

package info (click to toggle)
mrtg 2.9.17-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,140 kB
  • ctags: 1,517
  • sloc: perl: 22,688; ansic: 3,536; sh: 1,309; makefile: 319; php: 227; awk: 213; csh: 49; exp: 16
file content (14 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl
# Displays disk info to the hosts that connect to it.
#
# No command line options, just put it in /etc/inetd.conf as shown in
# the README file.
#
# By Steven Micallef <smic@wire.net.au> on the 24/4/1999.

foreach $_ (`df -k | grep -v "Filesystem"`)
{
  ($device, $size, $used, $free, $percent, $mount) = split(/\s+/);
  chop($percent);
  print "$percent\n";
}