File: linuxload.sh

package info (click to toggle)
netmrg 0.20-7
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,896 kB
  • ctags: 2,012
  • sloc: php: 9,401; sh: 4,791; cpp: 2,898; perl: 621; ansic: 381; makefile: 337; 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