Added the actual script.
This commit is contained in:
parent
972a067c3d
commit
080de8eb45
1 changed files with 13 additions and 0 deletions
13
set_myhostname.sh
Normal file
13
set_myhostname.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
IP=$(curl ifconfig.me)
|
||||
curl_retval=$?
|
||||
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
|
Loading…
Reference in a new issue