2 # setup hostname in /etc/hosts. use IP if no name available.
3 echo cyberhq > /tmp/local_name
5 host $4 | fgrep Name | cut -c7- > /tmp/ip_name
6 if [ ! -s /tmp/ip_name ]; then
9 cat /tmp/ip_name > /etc/sendmail.cw
10 paste /tmp/ip /tmp/ip_name /tmp/local_name > /tmp/host_bottom
11 cat /etc/hosts.top /tmp/host_bottom > /etc/hosts
12 rm /tmp/ip /tmp/ip_name /tmp/host_bottom /tmp/local_name
13 # Restart sendmail with new name.
14 kill -HUP `head -1 /var/run/sendmail.pid`
15 # Start fetchmail as root to fetch our mail.