Update 'set_myhostname.sh'
Removed some testing code
This commit is contained in:
parent
080de8eb45
commit
2b87c4b01c
1 changed files with 7 additions and 3 deletions
|
@ -2,12 +2,16 @@
|
||||||
|
|
||||||
IP=$(curl ifconfig.me)
|
IP=$(curl ifconfig.me)
|
||||||
curl_retval=$?
|
curl_retval=$?
|
||||||
|
|
||||||
|
if [ $curl_retval -gt 0 ]
|
||||||
|
# TODO send warning email to postmaster here
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
host_answer=$(host "$IP")
|
host_answer=$(host "$IP")
|
||||||
rev_dns="${host_answer##* }"
|
rev_dns="${host_answer##* }"
|
||||||
rev_dns="${rev_dns%.}"
|
rev_dns="${rev_dns%.}"
|
||||||
|
|
||||||
echo "Rev. DNS is: $rev_dns"
|
echo "Rev. DNS is: $rev_dns"
|
||||||
|
|
||||||
sed -e "s/^myhostname.*/myhostname = $rev_dns ses/" /etc/postfix/main.cf
|
sed -e "s/^myhostname.*/myhostname = $rev_dns/" -i /etc/postfix/main.cf
|
||||||
|
|
||||||
echo $curl_retval
|
|
||||||
|
|
Loading…
Reference in a new issue