行动…Don\'t ever let somebody tell you, you can\'t do something. you got a dream, you gotta protect it. people can\'t do something themselves they wanna tell you you can\'t do it.if you want something. go get it.
分类: LINUX
2016-03-18 16:45:02
#!/bin/bash
#program:
# This program is used to show
messages in screen!
#Author:
# linuxman
#history:
#
2010/09/27 linuxman First release
curtime=`date "+%T %F"`
title=linuxman
menu () {
cat
<
***************************
**
author:$title **
***************************
**1)localhost
ip **
**2)login
messages **
**3)error
messages **
**4)exit
**
***************************
linuxman
}
while :
do
clear
menu
echo -n " please choose
[1-4]:"
read num
case $num in
1)
echo -e "local ip:\n
`ifconfig | awk '/inet addr/{ print $2 }' | awk
-F
: '{ print $2 }' | grep -v "127"`"
echo -e "\n"
exit
;;
2)
hoch="`grep -iE
"accepted" /var/log/secure`" && echo
"$hoch" || echo
"
no messages!"
exit
;;
3)
hoch="`grep -iE
"failed|error|not" /var/log/messages`" && echo
"$hoch"
|| echo -e "\n \t(*!*)no messages!"
echo -e "\n"
exit
;;
4)
exit
;;
*)
clear
continue
;;
esac
done