#!/bin/bash subject="maintenance report (`date '+%Y/%m/%d %T'`)" msg="$subject" msg="$msg\nuptime: `cat /proc/uptime | awk '{print $1 / 60}'` min" tmp="" for i in `/sbin/ifconfig | /bin/grep "Link encap:" | /usr/bin/awk '{print $1}'`; do tmp="$tmp$i:`/sbin/ifconfig $i | \\ /bin/sed 's/inet addr:/inet addr: /' | \\ /bin/grep "inet addr:" | \\ /usr/bin/awk '{print $3}'`, "; done msg="$msg\n$tmp" msg="$msg\n----" msg="$msg\n`cat /var/log/messages`" #echo -e "$msg" #echo -e "$msg" | /usr/bin/mail -s "$subject" root echo -e "$msg" | /usr/bin/mail -s "$subject" hiroshi.yamada@gmail.com