Path: blob/master/Documentation/admin-guide/aoe/status.sh
26288 views
#! /bin/sh1# collate and present sysfs information about AoE storage2#3# A more complete version of this script is aoe-stat, in the4# aoetools.56set -e7format="%8s\t%8s\t%8s\n"8me=`basename $0`9sysd=${sysfs_dir:-/sys}1011# printf "$format" device mac netif state1213# Suse 9.1 Pro doesn't put /sys in /etc/mtab14#test -z "`mount | grep sysfs`" && {15test ! -d "$sysd/block" && {16echo "$me Error: sysfs is not mounted" 1>&217exit 118}1920for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do21# maybe ls comes up empty, so we use "end"22test $d = end && continue2324dev=`echo "$d" | sed 's/.*!//'`25printf "$format" \26"$dev" \27"`cat \"$d/netif\"`" \28"`cat \"$d/state\"`"29done | sort303132