1. Introduction:
Server is sometimes through the DHCP to obtain IP, the general server with a network cable and power is good, if each boot also have to connect a monitor and keyboard to see how much IP is inconvenient. Lazy people let it send a message automatically. Here use centos,163 mailbox, mail and so on.
2. Guarantee 163 mailbox Open Pop3/smtp/imap Service
3. Configure the CentOS Mail
#vim/etc/mail.rcsetfrom [email protected]163. com smtp=smtp. 163. com [email protected]163. com smtp-auth-password=password smtp-auth=login
Note: password refers to 163 mailbox Authorization code, sometimes password can also, password is clear way, so I specifically applied for a new 163 mailbox.
4. Boot from boot
# vim /etc/rc.d//root/autoexecofleaf &
# vim/root/autoexecofleaf#!/bin/bashsleep 1mifconfig" New IP address of T420"2@qq. comifconfig"new IP address of T420"1@qq. com
Note: Use Rc.local to set up the boot script, but the log output is unable to parse the host at the beginning of the test, it is estimated that the system has not initialized the network, so the script is run in the background, script hibernation 1minutes (forced bypass the START process = =)
5. Notes
Post-Boot related log view:
Change the first line of the rc.local to #!/bin/bash-x, and then/var/log/messages the file with the corresponding output (VIM, search rc.local)
Also, 163 of servers focus on check for new mailboxes and are likely to be considered junk e-mail.
CentOS-boot automatically send IP to designated mailbox-smtp.163.com