#!/bin/bash

/etc/init.d/sendmail start

sleep 2

IP=`/sbin/ifconfig|/bin/grep 14.0|/bin/awk '{print $2}'| /bin/cut -f 2 -d :`

/bin/mail -s "$IP Boot Log" abc@abc.com < /var/log/dmesg

sleep 5

/etc/init.d/sendmail stop



### dmesg를 메일로 보내는 스크립트

# IP를 추출

# mail 명령어를 통해서 dmesg를 특정 메일주소로 발송

'IT Study > script' 카테고리의 다른 글

mysql table backup scripts  (0) 2016.02.19
redis process check scripts  (0) 2016.02.19
hostname 변경하는 스크립트  (0) 2016.02.19
nfs를 이용한 간단한 백업 스크립트  (0) 2016.02.19
tomcat 프로세스 재구동 스크립트  (0) 2016.02.19

+ Recent posts