From 2b87c4b01c72745bc0008258f7e577e7f1612e22 Mon Sep 17 00:00:00 2001 From: The_Lie Date: Wed, 24 Mar 2021 01:14:45 +0100 Subject: [PATCH] Update 'set_myhostname.sh' Removed some testing code --- set_myhostname.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/set_myhostname.sh b/set_myhostname.sh index a88dad5..ba9429f 100644 --- a/set_myhostname.sh +++ b/set_myhostname.sh @@ -2,12 +2,16 @@ IP=$(curl ifconfig.me) curl_retval=$? + +if [ $curl_retval -gt 0 ] + # TODO send warning email to postmaster here + exit 1 +fi + host_answer=$(host "$IP") rev_dns="${host_answer##* }" rev_dns="${rev_dns%.}" echo "Rev. DNS is: $rev_dns" -sed -e "s/^myhostname.*/myhostname = $rev_dns ses/" /etc/postfix/main.cf - -echo $curl_retval +sed -e "s/^myhostname.*/myhostname = $rev_dns/" -i /etc/postfix/main.cf