File: linuxload.sh

package info (click to toggle)
netmrg 0.20-6.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,884 kB
  • sloc: php: 9,401; sh: 4,749; cpp: 2,898; perl: 621; ansic: 381; makefile: 331; xml: 92; sql: 71; sed: 16
file content (12 lines) | stat: -rwxr-xr-x 227 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# Author: Uwe Steinmann <uwe@steinmann.cx>

# usage linuxload.sh <item>
#   item can be 1, 2, or 3

if [ -f /proc/loadavg -a "$1" != "" -a $1 -ge 1 -a $1 -le 3 ]; then
	cut -d' ' -f$1 /proc/loadavg
else
	echo "U"
fi