#!/bin/sh

exec >>/root/bond0.log 2>&1

fmt=" %-20s '%s'\n"
fmt2=" %-20s '%s' OLD '%s'\n"

echo ============================================================
echo $0 $*
echo ============================================================
date
echo ============================================================
echo
echo "DUMP of /sys/class/net/bond0/bonding"
echo
for i in $(ls "/sys/class/net/bond0/bonding/"*)
do
	n=$(basename $i)
	v=$(cat "$i")
	if [ -f /tmp/__$n ]
	then
		o=$(cat /tmp/__$n)
	fi
	if [ "X$v" != "X$o" ]
	then
		printf "$fmt2" "$n" "$v" "$o"
	else
		printf "$fmt" "$n" "$v"
	fi
	echo "$v" >/tmp/__$n
done
echo
echo ============================================================
echo
exit 0
