linux开机提示信息脚本 #!/bin/sh ############################################################# # Filename: motd.sh # Revision: 1.1 # Date: 2017/07/28 # Author: doublelinux # Website: doublelinux.blog.51cto.com ############################################################# DATE=`date` UPTIME=`uptime|awk ‘{print $2,$3,$4,$6,$7}‘` #load average=`` LAST_LOGIN=`last|awk ‘NR==1{print $1}‘` IP=`ifconfig|awk ‘NR==2{print $2}‘` echo -e "\E[1;34m||---------------------------------------------------------||\E[0m" echo -e "\E[1;34m||-------------------\E[1;32mAuthor:doublelinux\E[0m\E[1;34m--------------------||\E[0m" echo -e "\E[1;34m||---------------------------------------------------------||\E[0m" #echo -e " \E[1;31m $DATE \E[0m" echo -e "\E[1;34m||\E[1;32m Welcome back,\E[5;31m$USER!\E[0m \E[1;32mWish you have a nice day! \E[1;34m||\E[0m" echo -e "\E[1;34m||\E[1;32mDate:========> $DATE \E[1;34m||\E[0m" echo -e "\E[1;34m||\E[0m\E[1;32mFdisk:=======> Size=`df -h|awk ‘NR==2{print $2}‘`;Used=`df -h|awk ‘NR==2{print $3}‘`;Avail=`df -h|awk ‘NR==2{print $4}‘`;Use%=`df -h|awk
‘NR==2{print $5}‘` \E[1;34m||\E[0m" echo -e "\E[1;34m||\E[1;32mModel name:==>`cat /proc/cpuinfo |awk -F":" ‘/^model name/{print $2}‘|awk ‘NR==1‘` \E[1;34m||\E[0m" echo -e "\E[1;34m||\E[1;32mUptime:======> $UPTIME \E[1;34m||\E[0m" echo -e "\E[1;34m||\E[1;32mLast_login:==> $LAST_LOGIN \E[1;34m||\E[0m" echo -e "\E[1;34m||\E[1;32mIP addr:=====> $IP \E[1;34m||\E[0m" #echo -e "\E[1;34m||\E[1;32m \E[1;34m||\E[0m" #echo -e "\E[1;34m||\E[1;32m \E[1;34m||\E[0m" #echo -e "\E[1;34m||\E[1;32m \E[1;34m||\E[0m" #echo -e "\E[1;34m||\E[1;32m \E[1;34m||\E[0m" #echo -e "\E[1;34m||\E[1;32m \E[1;34m||\E[0m" #echo -e "\E[1;34m||\E[1;32m \E[1;34m||\E[0m" #echo -e "\E[1;31m fdisk: \E[0m" echo -e "\E[1;34m||---------------------------------------------------------||\E[0m" echo -e "\E[1;34m||---------------------------------------------------------||\E[0m"
时间: 2024-10-23 08:28:33